views:

79

answers:

3

Hi, 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?

A: 

I'm not a linux guy, but I did a search and I found this. Does it help at all? (see section 4.3)

http://curl.haxx.se/docs/httpscripting.html

Gabriel McAdams
A: 

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.

Andras Zoltan
A: 

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.

Joel Etherton