Cannot upload file - 501
am 07.01.2008 18:54:45 von Kevin
Hi,
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 - 192.168.1.111 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?
Thanks,
Kevin
Re: Cannot upload file - 501
am 08.01.2008 07:50:13 von David Wang
On Jan 7, 9:54=A0am, Kevin wrote:
> Hi,
>
> 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 serve=
r 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 send=
ing
> 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 - 192.168.1.111 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 t=
o the
> directory where I want the files. I realized this was a "security" issue w=
hen,
> on my local PC, I allowed "write" to both the virtual directory and the ph=
ysical
> 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 us=
ing
> the HttpSendRequestEx() function to start the file transfer, and
> InternetWriteFile() function to send the file in blocks. The strange behav=
ior on
> the remote side is that I can go through the entire write process, but the=
re is
> no file on the other side. Again, the error code (501) and the security is=
sues
> are the cause.
>
> Could someone please tell me what I'm doing wrong here and how to fix it?
>
> Thanks,
> Kevin
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
UI.
http://blogs.msdn.com/david.wang/archive/2005/08/20/Why-can- I-upload-a-file-=
without-IIS-Write-Permission.aspx
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//