UploadFile()

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
C

Ching-Lung

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


.
 
J

Joerg Jooss

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top