http put requests in iis 5.1 cause 403

fishjie

Senior member
Apr 22, 2006
234
0
76
www.youtube.com
Ok this isn't exactly a programming question, but I figured this would be a good place to start. If another forum would be better for this, then I apologize and a mod can move it. I am currently trying to implement the ATOM API on the server side. One of the requests that ATOM handles are HTTP PUT verbs.

However, whenever I make a client side PUT request, the server always returns 403. When I set a breakpoint on the server side, it never gets hit.

I'm running IIS 5.1 on my machine. Here is what I've tried so far:
I go to: IIS->default web site->properties->home directory->Configuration
From there I click .ashx, edit, and make sure PUT is one of the verbs (I am using a .ashx file to handle requests).

Then I go to
IIS->default web site->properties->edit global configuration->authorization
Sure enough, it allows all verbs.

keep in mind, the ATOM PUT requests do not physically touch any files on the filesystem. So it shouldn't be a permissions error (or is it?). The Put request is made to a uri, of course it doesnt correspond to an actual file, but then my code does what it needs to do.

any ideas? thanks guys.
 

ahurtt

Diamond Member
Feb 1, 2001
4,283
0
0
I do believe you will need to set Write permissions at the file system level for the directory that corresponds to the URI for which you want to do the PUT. 403 HTTP status == forbidden access. I also found a post saying:

You have to grant both of these:

* write permission to the virtual directory in IIS (i.e. the permission for HTTP PUT). Without, you'll get a HTTP 403 error.
* write permission for the IIS process identity (e.g. IUSR_<MACHINENAME>) on the actual directory on the file system. Without, you'll get a HTTP 401 error.


Original thread: http://forums.microsoft.com/MS...PostID=707958&SiteID=1

So in short, yes I do think it might be a permissions problem.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
It could be a folder where script execution is disabled, or the script page itself may not have execute permission.

If so, a GET to the same page would also return 403.
 

fishjie

Senior member
Apr 22, 2006
234
0
76
www.youtube.com
@davesimmons: get and post requests work perfectly.

@ahurtt: i have granted write access to the virtual directory and still get the error. i did iisreset and even rebooted my machine desperately hoping it would work. i love how in the thread you linked me to, the last post the guy just said, dont use PUT. haha, i wish that were an option. but its part of the ATOM spec unfortunately.

So here's the thing. If this is a permissions error, there should be SOME entry in SOME log right?

ive looked at eventvwr and nothing. What monitoring tool should I use (filemon? netmon?) and what events should I be looking for?
 

fishjie

Senior member
Apr 22, 2006
234
0
76
www.youtube.com
DOH!

ok, so in my first post, I said I went to I

IS->default web site->properties->home directory->Configuration
From there I click .ashx, edit, and make sure PUT is one of the verbs (I am using a .ashx file to handle requests).

BUT, the ashx I am using is in a virtual directory under the root. I had assumed the .ashx allow PUT verb would have been applied recursively, but I was wrong. I went to the actual virtual directory and manually added it there. Once I did that, it worked!

Oh and for the record, I did not need write permission on the virtual directory. Again, none of my code is touching anything on the file system itself, and put request is not to a physical address on the file system.

Thanks for the help.