Re: Cannot upload file - 501

On Jan 7, 9:54 am, Kevin <kev...@xxxxxxxxxxxxxxxxx> wrote:

First, I'm fairly new to using/administrating IIS. So, speak slow and in a clear
voice ;-)

I'm writing a mobile application (currently testing on a PC) where I need to
send a potentially large file (up to 2MB) to the web server. The web server is
IIS 5.1 on Windows Server 2003 R2 (SP2). I'm using WinInet functions to do the
request and transfer of the file. I finally and successfully achieved sending
the large file on my local Windows XP Pro PC. The errors that I'm getting (from
the logs) are:

PUT /Uploads/testfile.xml - 8888 - HTTP 501 0 0 42546

I performed essentially the same actions on both servers (local and remote). I
created a virtual directory off of the web site directory and pointed it to the
directory where I want the files. I realized this was a "security" issue when,
on my local PC, I allowed "write" to both the virtual directory and the physical
directory. I tried the transfer and it worked. Now, I'm lost as to what I'm
doing wrong on the remote (Win2003) side. I've tried to set the same
permissions, but with no success.

I know the process I'm using works, so it is not on my client side. I'm using
the HttpSendRequestEx() function to start the file transfer, and
InternetWriteFile() function to send the file in blocks. The strange behavior on
the remote side is that I can go through the entire write process, but there is
no file on the other side. Again, the error code (501) and the security issues
are the cause.

Could someone please tell me what I'm doing wrong here and how to fix it?


You need to enable "Write" permission on the vdir in IIS as well as
enable "WebDAV" in Web Service Extensions node inside of IIS Manager