0

I am writing one program receives data files from the web browser.

HTML code:

<form action="http://192.168.0.102:8080/sync/uploadfile" method="post" enctype="multipart/form-data">
&nbsp; <input type="submit" value="Upload File"><br />
</form>

Data received:

------WebKitFormBoundarysKV9CFx7LDIr5T1A
Content-Disposition: form-data; name="uploadFile"; filename="icon.png"
Content-Type: image/png
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
------WebKitFormBoundarysKV9CFx7LDIr5T1A--

I'm having problems when processing the data submitted from the browser.
I want to convert the data to file.

Please help me how to solve problem.

GSerg
  • 76,472
  • 17
  • 159
  • 346
  • How are you receiving? ASP.NET? A socket? – Alex K. Nov 02 '14 at 14:53
  • possible duplicate of [Reading file input from a multipart/form-data POST](http://stackoverflow.com/questions/7460088/reading-file-input-from-a-multipart-form-data-post) – Alex K. Nov 02 '14 at 15:00

1 Answers1

0

when you receive the data as a string you could just call File.WriteAllText("Path","Data");

Edit:

Please see this StackOverflow post:

How do I save a stream to a file in C#?

Community
  • 1
  • 1
Venson
  • 1,772
  • 17
  • 37