UploadFile()

  • Thread starter Thread starter Ching-Lung
  • Start date Start date
C

Ching-Lung

Hi,

UploadFile() in System.Net.WebClient is always throwing
WebException: "The remote
server returned an error: (405) Method Not Allowed."

Is there any setting that I miss? IIS setting?

Please help, thanks!
-CL
 
Ching-Lung,

Are you using the POST or the PUT action? On IIS, if you want to use
POST, then you have to code the solution yourself (in an ASPX/ASP page). If
you use PUT, then you have to set the setting for the directory to accept
PUT requests.

Hope this helps.
 
Nicholas,

I am new in this web stuff. I believe that I am using
POST method on my form tag. I don't know if a form tag
can have PUT method because VS .NET only shows get or
post.

Do you have an example how to set IIS to enable PUT? Or
any code example to handle POST?

Please help, thanks!
-CL


-----Original Message-----
Ching-Lung,

Are you using the POST or the PUT action? On IIS, if you want to use
POST, then you have to code the solution yourself (in an ASPX/ASP page). If
you use PUT, then you have to set the setting for the directory to accept
PUT requests.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Ching-Lung said:
Hi,

UploadFile() in System.Net.WebClient is always throwing
WebException: "The remote
server returned an error: (405) Method Not Allowed."

Is there any setting that I miss? IIS setting?

Please help, thanks!
-CL


.
 
Ching-Lung said:
I am new in this web stuff. I believe that I am using
POST method on my form tag. I don't know if a form tag
can have PUT method because VS .NET only shows get or
post.

Do you have an example how to set IIS to enable PUT?

Using the IIS admin console, simply grant write permissions on the
particular virtual directory or subdiretory.
Or any code example to handle POST?

That can be easily achieved using ASP.NET (Servlets, JSP, ...), but not
without some server-side code.

Cheers,
 
Back
Top