I have a client application that makes a POST
request to asp.net URL
( it is used to uplaod a file to .NET
).
How to make asp.net page receives this request and save it as a file ?
@ Darin Dimitrov
I have tried your code, but I got 500 internal server error
how can I track it ?!
You can also save the entire request using
Assuming the data is not being uploaded as multipart/form-data
If the client uses
multipart/form-data
request encoding (which is the standard for uploading files) you could retrieve the uploaded file from theRequest.Files
collection. For example:or if you know the name used by the client you could directly access it:
If on the other hand the client doesn't use a standard encoding for the request you might need to read the file from the
Request.InputStream
.