problems with http file upload to wcf-rest service -


i upload file using form this:

<form action="http://127.0.0.1:8090/myservice/"        method="post" enctype="multipart/form-data">   <p>select file<br>      <input name="datei" type="file" size="50">      <input type="submit" value="submit">   </p> </form> 

and have wcf service this:

[servicecontract] public interface idocumentconverter {     [operationcontract, webinvoke(uritemplate = "/", method = "post")]     void uploadfile(stream filecontents);          } 

i have 2 problems this. when write stream file not contain file data http stuff. seems odd. there nice way raw file data?:

-----------------------------67832811011758 content-disposition: form-data; name="datei"; filename="haha.jpg" content-type: image/jpeg  ÿØÿà... 

the original file looks this:

ÿØÿà... 

secondly have filename in wcf. ideally this:

[servicecontract] public interface idocumentconverter {     [operationcontract, webinvoke(uritemplate = "/{filename}", method = "post")]     void uploadfile(string filename, stream filecontents);          } 

but not working, because don't know how integrate filename url using form/input stuff.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -