405 - HTTP verb used to access this page is not allowed

We are in the process of moving our Intranet from a machine running Windows Server 2003 to a virtual machine running Windows Server 2012 R2.  The Intranet was created by a vendor who is no longer in business.  Most of it consist of classic asp pages and for the most part it runs fine on the new machine.

It has a asp page with a form on it that should allows users to upload files.  It works on the old server but not on the new one.  On the new one we get the error in the title of this post.  The pertinent HTML code is below.

<form method="POST" action="upload_action.aspx?folder=<%=request("folder")%>"enctype="multipart/form-data">
     <input type="FILE" name="FILE1" size="50"/>
      <input type="SUBMIT" value="Upload"/>
</form>

It should post to a aspx file but it never gets there.  As soon as the button is click the error page comes up.

In IIS under Request Filtering for the Default Web Site in the HTTP Verbs tab I've added the verb "POST" and set Allowed to "True"

On the File Name Extension tab I've added ".aspx" and set allowed to true.

Any suggestions would be greatly appreciated.
leskellyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
a similar question was asked here:

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/Q_22133787.html

can you confirm the steps taken here match what you've done?
0
leskellyAuthor Commented:
Not really as I'm dealing with IIS 8 and those instructions are for an earlier version of IIS so I'm not sure if I've don't exactly what was suggested but as I said in my question I went into IIS under Request Filtering for the Default Web Site in the HTTP Verbs tab I've added the verb "POST" and set Allowed to "True".  There are no other verbs listed there but under Alerts it says that no other verbs are blocked.  Do I need to add other verbs even though Post is what the code is using?

In the Edit Request Filtering Settings for the Post verb I added it has the Max allowed content length as 30000000, Max URL length as 4096 and the Max query string as 2048.
0
leskellyAuthor Commented:
I saw that article as well and no WebDav is not installed.

The delete verb is not explicitly allowed but it is not blocked either.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
did you try explicitly allowing it?
0
leskellyAuthor Commented:
I did just now but with the same results.
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
can you provide a screen shot of all of your verbs that are listed?

also, if you post to a regular old asp page using the code above,, I assume it works?
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Did you add permissions for the folder to accept the file?  

Was the old site using a dll that needs to be registered?
0
leskellyAuthor Commented:
Hello Big Monty,

I tried modifying the code so it post to an asp page in the same folder.  It didn't do anything because the page didn't have the code in it but it didn't throw an error either.

I've attached a screen shot of the verbs.
RequestFiltering.jpg
0
leskellyAuthor Commented:
I was mistaken.  While doing the test with the regular asp page I had inadvertavtly gone to the old server.  When I redid the test on the correct server I get a, "http 500 The website cannot display the page" error.
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
off to a doc appt, so I'll respond later this afternoon, but quick question, can you get the exact error message? this involves going to IIS and making sure "send errors to browser" is checked in the ASP section

also, can you provide a screen shot of the verbs of the old server as well? I havent looked at the one you provided but maybe it'll reveal something
0
leskellyAuthor Commented:
I've attached a screen shot of the old server verbs.  I all set "Send Errors To Browser" to true but it doesn't give much more.  The complete error message is:

405 - HTTP verb used to access this page is not allowed.
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
OldServerVerbs.jpg
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
try adding verbs for GET, HEAD, and DEBUG, so that it matches the old server
0
leskellyAuthor Commented:
I added the three extra verbs but it didn't have any impact.
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
did you restart IIS?
0
leskellyAuthor Commented:
I had not initially but I just did and still the same results.
0
leskellyAuthor Commented:
Scott,

I'm sorry it took so long for me to get back to you.  The asp application is running under the Classic ASP application pool identity which has permissions on the folder and just to test it out I gave it full control.

In regard to your other question, no there is no dll on the old server that had to be registered.
0
leskellyAuthor Commented:
Just to clarify a point, the folder that the file is supposed to be uploaded to is a sub-folder of the folder the asp and aspx files are in.
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
not sure I'm clear on that last statement...

your form code is

<form method="POST" action="upload_action.aspx?folder=<%=request("folder")%>"enctype="multipart/form-data">

is upload_action.aspx in the same folder as the calling page?
0
leskellyAuthor Commented:
Yes
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
in your original question, you said

On the File Name Extension tab I've added ".aspx" and set allowed to true.

do you have one for asp as well?
0
leskellyAuthor Commented:
I did not but I do know.  Unfortunately I still get the same error.
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
I'm pretty stumped here, we've listed all of the verbs needed, you have an actual page name specified in your code (if you had just a folder, it would error). you're positive WebDav is not installed, correct? Not just disabled but completely gone from the system (it would be unchecked when you go to Add/Remove Windows Components)?

is the page public?
0
leskellyAuthor Commented:
Good morning,

If it is morning wherever you are.  Yes WebDav is not installed.  If you look in the attachment you'll see a screen shot of the "Remove Roles and Features Wizard".
0
leskellyAuthor Commented:
Here is the attachment.
WebDav.jpg
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
morning to you too (although its afternoon right now)! I'm on the East Coast, just outside of Boston :)

ya I'm pretty stumped...and at this point I'm just throwing out ideas and crossing off suggestions of the list of things to try. I don't have an iis8 server handy to try things myself...

did you ever try moving the files to the root of the website? this would eliminate any permissions issues I suppose...

do you have a link to the page so that I could take a look?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leskellyAuthor Commented:
I tried moving the files to the root but had the same result.  The page is on an internal Intranet so I can't give you a link to it but here is the code:
<%
if request("folder") <> "" then
	strFolder = replace(request("folder"), "%20", " ")
else
	response.redirect("myfolders.asp")
end if

FolderPath = "e:\websites\PeopleNET\FileShare\Files\" & strFolder

if request("DelFile") <> "" then
	Set fso = CreateObject("Scripting.FileSystemObject")
	Set fileObject = fso.GetFile(FolderPath & "\" & request("DelFile"))
	fileObject.Delete
end if

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>My Folders</title>
<style>
BODY
{
    BACKGROUND-COLOR: #FFFFFF
}
TD
{
    FONT-WEIGHT: normal;
    FONT-SIZE: 10pt;
    COLOR: #000000;
    FONT-FAMILY: Verdana,Tahoma,Arial,Helvetica
}
.formClass
{
    BACKGROUND-COLOR: #FFFFFF;
    FONT-WEIGHT: normal;
    FONT-SIZE: 10pt;
    COLOR: black;
    FONT-FAMILY: Verdana,Tahoma,Arial,Helvetica
}
.lightRow {
	BACKGROUND-COLOR: #fafafa
}
.darkRow {
	BACKGROUND-COLOR: #ededed
}
.titleRow {
	BACKGROUND-COLOR: white
}
.loginRow {
	border: black solid 1px;
	BACKGROUND-COLOR: black
}
.boldText
{
    FONT-WEIGHT: bold
}
A
{
    FONT-WEIGHT: bold;
    COLOR: black;
    TEXT-DECORATION: none
}
A:hover
{
    COLOR: red;
    TEXT-DECORATION: none
}
A:visited
{
    TEXT-DECORATION: none
}
A:active
{
    TEXT-DECORATION: none
}
</style>
</head>

<body>
  <TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
    <TBODY>
      <TR class=lightRow height=60>
        <TD height="60" colspan="2"><DIV style="FONT-SIZE: 12pt">
          <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="83%">&nbsp;&nbsp;<img height=27 src="./images/folder_open_big.png"
width=32 align=absMiddle border=0>&nbsp;<span class=boldText><%=strFolder%></span> </td>
              <td width="17%" valign="middle"><div align="right"><a href="login.asp"><img src="images/logout.gif" align=absMiddle width="16" height="16" border="0"></a> <a href="login.asp">Logout&nbsp;&nbsp;</a></div></td>
            </tr>
          </table>
        </DIV></TD>
      </TR>
      <TR class=titleRow>
        <TD>&nbsp;&nbsp;</TD>
      </TR>
      <TR>
        <TD>
          <table width="100%" border="0" cellspacing="0" cellpadding="3">
		  <tr>
		  <td width="50%"><b>Name</b></td>
		  <td width="23%"><b>Size</b></td>
		  <td width="23%"><b>Date</b></td>
		  <td width="25">&nbsp;</td>
		  </tr>
		  <% BGColor = "darkRow" %>
		  <tr class="<%=BGColor%>">
		  <TD>&nbsp;<IMG src='./images/folder_up.png' align=absMiddle border=0>&nbsp;<a href="MyFolders.asp">Back to My Folders</a></TD>
		  <td></td>
		  <td></td>
		  <td></td>
		  </tr>
            
<%

Set fso = CreateObject("Scripting.FileSystemObject") 
Set folder = fso.getFolder(FolderPath)
Set files = folder.Files 

For Each file in Files 
		
	IF BGColor = "darkRow" THEN
		BGColor = "lightRow"
	ELSE
		BGColor = "darkRow"
	END IF

	Response.Write "<TR class=" & BGColor & ">" & vbNewLine
	Response.Write "<TD>&nbsp;&nbsp;&nbsp;&nbsp;<IMG src='./images/file.png' align=absMiddle border=0>&nbsp;<a href='files/" & strFolder & "/" & file.Name & "'>" & file.Name & "</a></TD>" & vbNewLine
	Response.Write "<TD>" & file.Size & "&nbsp;bytes</TD>" & vbNewLine
	Response.Write "<TD>" & file.DateCreated & "&nbsp;</TD>" & vbNewLine
	Response.Write "<TD><a href='browse_folder.asp?folder=" & request("folder") & "&DelFile=" & file.Name & "'><IMG src='./images/delete.png' border='0'></a>&nbsp;</TD>" & vbNewLine
	Response.Write "</TR>" & vbNewLine
	
Next 

Set files = folder.Files 
Set file = Nothing 
Set fso = Nothing 
%>

          </table></TD>
      </TR>
      <TR class=titleRow>
        <TD colSpan=2>&nbsp;</TD>
      </TR>
	        <TR class=lightRow height=60>
        <TD height="60" colspan="2"><DIV style="FONT-SIZE: 12pt">
          <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><strong>Upload a File:</strong></td>
            </tr>
            <tr>
              <td width="83%">  
                
                <form method="post" action="upload_action.aspx?folder=<%=request("folder")%>" enctype="multipart/form-data">
                    <input type="file" name="FILE1" size="50"/>
                    <input type="submit" value="Upload"/>
                </form>
              </td>
             </tr>
          </table>
        </DIV></TD>
      </TR>
    </TBODY>
  </TABLE>

</body>
</html>

Open in new window


This is the code to the upload_action.aspx file:
<%
    Try
        If Request.Files.Count = 1 AndAlso Not Request.Files(0).FileName Is Nothing AndAlso Request.Files(0).FileName <> "" Then
            Dim l_sFileName As String


            l_sFileName = Server.MapPath("./Files/" & Request.QueryString("folder") & "/" & System.IO.Path.GetFileName(Request.Files(0).FileName))

            If System.IO.File.Exists(l_sFileName) Then
                System.IO.File.Delete(l_sFileName)
            End If

            Request.Files(0).SaveAs(l_sFileName)
        End If

        Response.Redirect("browse_folder.asp?folder=" & Request.QueryString("folder"))

    Catch ex As Exception
        Response.Write(ex.ToString)
    End Try

%>

Open in new window

0
leskellyAuthor Commented:
I found the problem.  In IIS the app the page is running under was in the Classic ASP application pool instead of the .net v 2.0 application pool.
0
leskellyAuthor Commented:
As you spent consierable time trying to help me through this issue the points are yours.
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
that's great, glad you got it working!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.