Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I was a little confused with jQuery-File-Upload myself, but after reviewing the plugin documentation I found what is needed for the plugin to work on Windows environment.</p> <p>PROBLEM 1: FILE SAVING - regarding this issue, make sure that you are saving to a valid and previously created directory, and also that you have WRITE permissions to that directory.</p> <p>PROBLEM 2: UPLOAD POSTBACK - You must setup your upload script to write the uploaded file, AND return a valid JSON response to the plugin, as defined on the plugin documentation: <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#using-jquery-file-upload-ui-version-with-a-custom-server-side-upload-handler" rel="nofollow noreferrer">https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#using-jquery-file-upload-ui-version-with-a-custom-server-side-upload-handler</a></p> <pre><code>if (context.Request.Files.Count &gt; 0) { HttpFileCollection files = context.Request.Files; for (int i = 0; i &lt; files.Count; i++) { HttpPostedFile file = files[i]; string fname = context.Server.MapPath("~/uploads/" + file.FileName); file.SaveAs(fname); } } upload_response = '{"files":[{"name": ' + file.FileName + '","size":' file.FileSize + ',"url":"http:\/\/example.org\/files\/ + file.FileName + ",' upload_response =+ '"thumbnailUrl": "http:\/\/example.org\/files\/thumbnail\/ + file.FileName + ","deleteUrl": "http:\/\/example.org\/files\/ + file.FileName + ",' upload_response =+ '"deleteType": "DELETE"}]}"' context.Response.ContentType = "application/json"; context.Response.Write( upload_response ); </code></pre> <p>Please note that I also changed the ContentType to "application/json". The syntax of this code may not be complete, but the most important is to output these JSON fields required by the plugin.</p>
    singulars
    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. 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