UploadFile()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ching-Lung

    UploadFile()

    Hi,

    UploadFile() in System.Net.WebC lient 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
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: UploadFile()

    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]
    - mvp@spam.guard. caspershouse.co m

    "Ching-Lung" <cltjiong@hotma il.com> wrote in message
    news:0d1701c3ae e4$7a74b030$a00 1280a@phx.gbl.. .[color=blue]
    > Hi,
    >
    > UploadFile() in System.Net.WebC lient 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[/color]


    Comment

    • Ching-Lung

      #3
      Re: UploadFile()

      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


      [color=blue]
      >-----Original Message-----
      >Ching-Lung,
      >
      > Are you using the POST or the PUT action? On IIS,[/color]
      if you want to use[color=blue]
      >POST, then you have to code the solution yourself (in an[/color]
      ASPX/ASP page). If[color=blue]
      >you use PUT, then you have to set the setting for the[/color]
      directory to accept[color=blue]
      >PUT requests.
      >
      > Hope this helps.
      >
      >
      >--
      > - Nicholas Paldino [.NET/C# MVP]
      > - mvp@spam.guard. caspershouse.co m
      >
      >"Ching-Lung" <cltjiong@hotma il.com> wrote in message
      >news:0d1701c3a ee4$7a74b030$a0 01280a@phx.gbl. ..[color=green]
      >> Hi,
      >>
      >> UploadFile() in System.Net.WebC lient 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[/color]
      >
      >
      >.
      >[/color]

      Comment

      • Joerg Jooss

        #4
        Re: UploadFile()

        "Ching-Lung" wrote:
        [color=blue]
        > 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?[/color]

        Using the IIS admin console, simply grant write permissions on the
        particular virtual directory or subdiretory.
        [color=blue]
        > Or any code example to handle POST?[/color]

        That can be easily achieved using ASP.NET (Servlets, JSP, ...), but not
        without some server-side code.

        Cheers,
        --
        Joerg Jooss
        joerg.jooss@gmx .net

        Comment

        Working...