WebClient Method Not Allowed

  • Thread starter Thread starter Arash
  • Start date Start date
A

Arash

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
 
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.
 
Back
Top