Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm using the uploadify plugin (http://www.uploadify.com/) - as Jeremy said, it's not in javascript - It's not possible. It's in flash. It's very easy to install.</p> <pre><code>$('#file_upload').uploadify({ 'uploader' : '/uploadify/uploadify.swf', 'script' : '/uploadify/uploadify.ashx', 'cancelImg' : '/uploadify/cancel.png', 'folder' : '/uploads', 'auto' : true, 'fileExt': '*.xls;*.xlsx;*.csv', 'buttonText': 'Select your file', 'onError' : function (event,ID,fileObj,errorObj) { alert(errorObj.type + ' Error: ' + errorObj.info); }, 'onComplete' : function(event, ID, fileObj, response, data) { var obj = jQuery.parseJSON(response); if (obj.error != "" &amp; obj.errror != null) { lblTable.html("error : " + obj.error); } else { lblTable.html(obj.table); lblEditData.show(); lblTable.hide(); } } }); </code></pre> <p>And on the uploadify.ashx :</p> <pre><code>public class uploadify : IHttpHandler { public void ProcessRequest(HttpContext context) { System.Web.HttpPostedFile file = context.Request.Files["Filedata"]; //Check extension string extension = ""; try { extension = file.FileName.Split('.')[file.FileName.Split('.').Length - 1]; if (extension != "xls" &amp; extension != "xlsx" &amp; extension != "csv") throw new Exception("Error of the extension"); } catch { context.Response.Write("{\"error\",\"Error with the extension of the file\""); } string linkFile = System.Web.HttpContext.Current.Server.MapPath("~") + "uploads" + "\\" + DateTime.Now.ToString("yyMMddHHmm") + APIReportPro.DocumentPDF.RandomString(4) + "." + extension; file.SaveAs(linkFile); ...etc... </code></pre> <p>This is the nicest solution I found for asp.net</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload