473,320 Members | 1,856 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,320 software developers and data experts.

WebClient Method Not Allowed

Hi everybody,
the previous error was my mistake but right now I changed the code to:

private void btnUpload_Click(object sender, System.EventArgs e)
{
WebClient mClient = new WebClient();
try{
mClient.UploadFile(" http://mymachine/Pars/Images/Cop.jpg
","D:\\Cop.jpg");
}catch(Exception el){
MessageBox.Show("Excep "+ el.ToString());
}
}

and this time I get the "Method Not Allowed" I have tried to set my web
persmissions for write executable from IIS 5.0 subweb's pop up menu ->
properties option ?!?!?
please help me with the force major case

Regards,
Arash
Nov 15 '05 #1
1 3227
Arash,

Do you allow file uploading in the directory specified? You need to
allow PUT by default on IIS in order for this to work. In other words, does
the URL "http://mymachine/Pars/Images" allow uploading? Or rather, does it
require a POST method to upload the data?

You have to make sure that the server is configured correctly to accept
file uploads.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Arash" <ar*************@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hi everybody,
the previous error was my mistake but right now I changed the code to:

private void btnUpload_Click(object sender, System.EventArgs e)
{
WebClient mClient = new WebClient();
try{
mClient.UploadFile(" http://mymachine/Pars/Images/Cop.jpg
","D:\\Cop.jpg");
}catch(Exception el){
MessageBox.Show("Excep "+ el.ToString());
}
}

and this time I get the "Method Not Allowed" I have tried to set my web
persmissions for write executable from IIS 5.0 subweb's pop up menu ->
properties option ?!?!?
please help me with the force major case

Regards,
Arash

Nov 15 '05 #2

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

Similar topics

2
by: Max Gattringer | last post by:
Hi, I've got a little problem with the WebClient, I always get a failure while debugging this code: private void menuItem2_Click(object sender, System.EventArgs e) { NameValueCollection...
6
by: A.M-SG | last post by:
Hi, I have an aspx page at the web server that provides PDF documents for smart client applications. Here is the code in aspx page that defines content type: Response.ContentType =...
3
by: Mariela | last post by:
I am trying to run the following C# code: ---------------------------------------- String uriString = "http://10.1.1.100/images/"; WebClient myWebClient = new WebClient(); string fileName =...
0
by: Kumar | last post by:
Hi all, I have the following code which uses WebClient.UploadValues myNameValueCollection.Add("Name", name) myNameValueCollection.Add("Age", age) .............. ............. Dim web As New...
3
by: Manuel | last post by:
I have an asp page ("test.asp") that presents the data it receives from a post.When I try the following code, test.asp doesn't return the values (supposedly) posted to it. If I make a web page with...
7
by: Crirus | last post by:
Hi all! I use a webClient for requesting data from a server of mine. Should I worry about long ammount of data sent by server in the client side? Or, another way, should I send some kind of a...
6
by: Giovanni | last post by:
Hi Guys, Really strange problem I am experiencing... I have setup a virtual directory with Read Only permissions on an ISA/IIS server (SBS 2003). In that virt. dir., I placed 1 file...
1
by: Mike | last post by:
I am using PowerShell to download an XML file into a string using the DownloadString(URI) method of System.Net.WebClient object. Sample commands below: $Result = $Null; $WebClient = new-object...
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...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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)...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.