Vibe.d form file attributes
    WebFreak001 via Digitalmars-d-learn 
    digitalmars-d-learn at puremagic.com
       
    Tue Dec 20 10:42:11 PST 2016
    
    
  
On Tuesday, 20 December 2016 at 18:22:51 UTC, aberba wrote:
> [...]
> Now I wanted to implement this in D (vibe.d) and here is what I 
> did in the file upload handler.
>
> void upload(HTTPServerRequest req, HTTPServerResponse res)
> {
>     import std.stdio;
>
>     foreach(picture; req.files) // req.files includes all 
> uploaded files
>     {
>         ...
>     }	
> }
> However, I want to filter out only those files with attribute 
> name of "picture[]" from req.files.  I tried req.files.name == 
> "picture[]" and other combination but there seem to be no 
> property like that
iterate over req.files like this instead:
foreach (name, picture; req.files) // name is "picture[]" now
{
     ...
}
> (How do I print all properties of req.files by the way? :) ).
pragma(msg, __traits(allMembers, typeof(picture)));
    
    
More information about the Digitalmars-d-learn
mailing list