Problem uploading files to Web server

F

FusionGuy

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top