Problem uploading files to Web server

Discussion in 'ASP .Net' started by FusionGuy, Oct 12, 2005.

  1. FusionGuy

    FusionGuy Guest

    I've created a file uploading handler, implemented as an httpHandler. Each
    time I attempt to upload a file, or files, my HttpContext.Request.Files
    property never contains the files that were uploaded. Here's a snippet of
    my handler code:

    // *** BEGIN HANDLER CODE *** //
    public class AutoUpload : IHttpHandler
    {
    public void ProcessRequest(HttpContext context)
    {
    HttpRequest request = context.Request;
    HttpResponse response = context.Response;
    HttpFileCollection coll = context.Request.Files;

    if (request.Files.Count > 0)
    {
    // code to save files locally...
    }
    }
    }
    // *** END HANDLER CODE *** //

    I'm posting files using the normal "<input type="file">" method and also
    ensuring that my enctype is set to "multipart/form-data" Just to be as
    verbose as possible, here's a snippet of the client-side code:

    // *** BEGIN CLIENT CODE *** //
    <form id="Form1" method="post" enctype="multipart/form-data"
    action="http://localhost/UploaderService/Uploader.aspx">
    <input type="file" id="txtUpload" style="WIDTH:250px">
    <br>
    <br>
    <input type="submit" value="Post It">
    </form>
    // *** END CLENTCODE *** //

    I've checked to make sure that I have Write permissions to the target
    directory and also have Write permissions set to allowed in IIS. Is there
    something I've missed here?? Thanks in advance.

    -Marc
     
    FusionGuy, Oct 12, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason

    Uploading files to the web server

    Jason, Jan 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    364
    Jason
    Jan 20, 2004
  2. FusionGuy

    Uploading files to Web server

    FusionGuy, Oct 17, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    11,356
    FusionGuy
    Oct 17, 2005
  3. Dung Ping
    Replies:
    10
    Views:
    1,061
    Chaddy2222
    Jan 16, 2006
  4. Phil Johnson
    Replies:
    3
    Views:
    995
    Phil Johnson
    Apr 9, 2008
  5. wym
    Replies:
    0
    Views:
    244
Loading...

Share This Page