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