asp.net - ASP .NET PageMethods - File Upload -



asp.net - ASP .NET PageMethods - File Upload -

i trying create ajaxy file upload.

here asp code:

<input type="file" id="supportingdocs" runat="server"/> <input type="button" id="uploadbtn" onclick="upload();" value="upload"/>

here javascript:

function upload() { pagemethods.uploadfile($get('supportingdocs').value, onsucceed, onfail); }

here relevant c# code:

[webmethod] [scriptmethod] public static string uploadfile(string files) { httprequest request = httpcontext.current.request ........ }

what trying httpfilescollection request empty. know pagemethods not follow normal asp .net lifecycle. looking @ httprequest object while stepping through code in debugging see else in request there "files" property empty. i'm missing here , method of uploading files might not possible.

you utilize 1 provided ajaxcontroltoolkit, i.e. asyncfileupload

asp.net asp.net-ajax

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -