I have a folder on my IIS instance called Uploads. I am doing an HTTP POST from my Android application to upload a file to the IIS server.
This isn't working. The operation looks like this (this is part of the failed request logging),
<failedRequest url="http://*ADDRESS*:80/JsonWCFService/Uploads"
siteId="1"
appPoolId=".NET4 App Pool"
processId="1176"
verb="POST"
remoteUserName=""
userName=""
tokenUserName="NT AUTHORITY\IUSR"
authenticationType="anonymous"
activityId="{00000000-0000-0000-6800-0080000000FA}"
failureReason="STATUS_CODE"
statusCode="200"
triggerStatusCode="405"
timeTaken="63"
xmlns:freb="http://schemas.microsoft.com/win/2006/06/iis/freb"
>
So we are getting a 405 there. Do I need to configure something more in IIS?
I am using the PhoneGap API to upload the file using the FileTransfer.upload method.
IIS
is aweb server
and it does not come with a build-inupload handler
. If you would like to upload files usingPOST
on a specificurl
you would have to create an actual web-application.Read more here: http://support.microsoft.com/kb/189651
The simplest solution that I can propose is to create a new
asp.net
project with aHttpHandler
- the code could look something like this (as simple as it can be):Please keep in mind that this is acceptable for small files, you should not use it for something heavier than couple of MB.