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. Advertisements

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. raymond chiu

    Uploading files to Windows Server

    raymond chiu, Jan 6, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    592
    =?Utf-8?B?Tm90SGVscGZ1bA==?=
    Jan 12, 2006
  2. Jason

    Uploading files to the web server

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

    Uploading files to Web server

    FusionGuy, Oct 17, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    11,680
    FusionGuy
    Oct 17, 2005
  4. Dung Ping
    Replies:
    10
    Views:
    1,438
    Chaddy2222
    Jan 16, 2006
  5. dermoon
    Replies:
    0
    Views:
    641
    dermoon
    Oct 8, 2003
  6. Phil Johnson
    Replies:
    3
    Views:
    1,225
    Phil Johnson
    Apr 9, 2008
  7. Andrew Chan

    Problems: uploading files have Chinese named files

    Andrew Chan, Apr 16, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    314
    Andrew Chan
    Apr 16, 2004
  8. wym
    Replies:
    0
    Views:
    348
Loading...