WebClient Method Not Allowed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Arash

    #1

    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.EventArg s e)
    {
    WebClient mClient = new WebClient();
    try{
    mClient.UploadF ile(" http://mymachine/Pars/Images/Cop.jpg
    ","D:\\Cop.jpg" );
    }catch(Exceptio n 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


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: WebClient Method Not Allowed

    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]
    - nicholas.paldin o@exisconsultin g.com

    "Arash" <arashpirayande h@hotmail.com> wrote in message
    news:%23J2F8CTf DHA.620@TK2MSFT NGP11.phx.gbl.. .[color=blue]
    > Hi everybody,
    > the previous error was my mistake but right now I changed the code to:
    >
    > private void btnUpload_Click (object sender, System.EventArg s e)
    > {
    > WebClient mClient = new WebClient();
    > try{
    > mClient.UploadF ile(" http://mymachine/Pars/Images/Cop.jpg
    > ","D:\\Cop.jpg" );
    > }catch(Exceptio n 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
    >
    >[/color]


    Comment

    Working...