473,327 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

UploadFile()

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
Nov 15 '05 #1
3 3851
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]
- mv*@spam.guard.caspershouse.com

"Ching-Lung" <cl******@hotmail.com> wrote in message
news:0d****************************@phx.gbl...
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

Nov 15 '05 #2
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 usePOST, then you have to code the solution yourself (in an ASPX/ASP page). Ifyou use PUT, then you have to set the setting for the directory to acceptPUT requests.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ching-Lung" <cl******@hotmail.com> wrote in message
news:0d****************************@phx.gbl...
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

.

Nov 15 '05 #3
"Ching-Lung" wrote:
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,
--
Joerg Jooss
jo*********@gmx.net
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David W | last post by:
I am trying to upload a file from a user's system to my web server. I found code using the WebClient.UploadFile method. However, the uploaded file is from the server's hard drive not the user's...
5
by: Ching-Lung | last post by:
Hi, UploadFile() 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
0
by: Saverio Tedeschi | last post by:
Hi all gurus, forgive me if I submit a 2nd post, but I'm no more able to see my question. So: I wrote an Win app with embedded FTP client (well, made some cut and paste from others' projects :-))...
1
by: Phillip N Rounds | last post by:
I'm having problems using the WebClient.UploadFile() command. I have MySender.ASPX which is supposed to upload two files to the server. There is also ConsumeFileUpload.aspx which is intended to...
5
by: linn | last post by:
The 'Address' parameter in the WebClient.UploadFile usually comes in the form of ie. http://server/Upload_File.aspx Hence my question, what is exactly the content of this Upload_File.aspx? Am i...
0
by: lgbjr | last post by:
Hi All, I thought this was going to be a simple task, but I just can't get this to work: I need to transfer a file from a client machine to a server using a windows app created with VB.Net...
2
by: UJ | last post by:
I'm trying to upload stuff using the UploadFile from WebClient and I've noticed that it adds header and footers to the stream. Is there any way to get rid of that automatically? I'm using...
0
by: Mihaly | last post by:
I have a WinForms 1.1 application and I want to post some files on the webserver, using WebClient.UploadFile() method. I try the solution from MSDN site -...
6
by: =?Utf-8?B?U2NvdHQgVHJpY2s=?= | last post by:
I followed the instructions from MSDN for Webclient UploadFile and I get an error: Could not find file 'C:\testfile.xls'. If I add the file (c:\testfile.xls) to the server I do not get the error...
5
by: benmess | last post by:
This code snippet works fine on a localhost because the file you upload resides on the host machine (where FileServer.aspx is a new page invoked from the UploadFile call) function...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.