file upload - Uploading with multipart/form-data using OpenRasta and IMultipartHttpEntity -


i'm trying post files using openrasta. i've gotten far getting handler called, appearances stream in entity empty. here's handler:

public operationresult post( ienumerable<imultiparthttpentity> entities) {     var foo = entities.tolist();     foreach (var entity in foo)     {         if (entity.stream != null && entity.contenttype != null)         {             var memorystream = new memorystream();             entity.stream.copyto(memorystream);         }     }     return new operationresult.created(); } 

each time through loop memorystream has length of 0. doing wrong?

nothing posting on stackoverflow make answer obvious. apparently 1 enumeration of entities in order grab stream. had added "foo" variable above make debugging easier, causing streaming fail. stored stream database, had failed reset memorystream beginning before writing it. fixing these 2 issues got file upload correctly.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -