javascript - jquery or ashx not working -
i using ajax file upload control.
it creating html:
<form action="/pages/handlers/asyncfileuploadhandler.ashx" method="post" enctype="multipart/form-data" target="ajaxuploader-iframe-1397144545"> <input type="hidden" name="type" value="mindvoice"> <input type="file" id="imagefile" style="display: block; width: 80%; margin-right: auto; margin-left: auto;"> </form> and target is:
<iframe width="0" height="0" style="display:none;" name="ajaxuploader-iframe-1397144545" id="ajaxuploader-iframe-1397144545"></iframe> the form submitted using .submit().
my ashx handler:
<%@ webhandler language="c#" class="asyncfileuploadhandler" %> using system; using system.web; using nettpals.core; public class asyncfileuploadhandler : ihttphandler { public void processrequest(httpcontext context) { var file = context.request.files[0]; // argumentoutofboundexception } public bool isreusable { { return false; } } } i don't know how handle file.
i'm using jquery ajaxfileupload
so should grab file?
finally worked. added name property <input type="file"> , worked fine.
Comments
Post a Comment