I have a device that uses a custom scripting language. This language provides the capability to set http request headers then perform a post to a URL. The server that the device communicates with is running .net, and I would like the handler on the server to retrieve data from the device by simply pulling it from the Request.Files[] collection. To do this, does the device need to support multipart posting or is it possible for the uploaded content to show up in the Files collection by simply setting a number of headers then sending the data?
-
what programming language is the "device"? – Gabriel McAdams Jan 07 '10 at 17:27
-
It's a custom scripting language. The device's system software uses Linux and libCurl for network communication. – Ted Shaffer Jan 07 '10 at 17:34
3 Answers
I'm not a linux guy, but I did a search and I found this. Does it help at all? (see section 4.3)

- 56,921
- 12
- 61
- 77
If you mean that at the server end you want the file(s) to be readable via HttpRequest.Files, then I believe so.
I think the format that this expects is based on the File Upload RFC and therefore if you follow the standard procedure for submitting a file upload then it'll work.
As to how you go about formatting the request from your device - I'm afraid I can't help on that one. Assuming you can format an Http Post, writing any headers you need and then formatting the Post body with the file content, it'll work, though.

- 41,961
- 13
- 104
- 160
In order for .Net to be able to read a file posted to a header it must be in the multipart posting format. Otherwise it will just be text noise in the header and .Net won't know what to do with it.

- 37,325
- 10
- 89
- 104