Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I believe you can do this using <a href="http://www.uploadify.com" rel="nofollow">Uploadify</a>. There are two options you'd want to look at. First, set <a href="http://www.uploadify.com/documentation/uploadify/auto/" rel="nofollow">auto to false</a> to prevent selected files from immediately being loaded. Second, use the <a href="http://www.uploadify.com/documentation/uploadify/formdata/" rel="nofollow">formdata option</a> to send along your other form fields along with the payload.</p> <p>You'd then call the <a href="http://www.uploadify.com/documentation/uploadify/upload/" rel="nofollow">upload method</a> when the user submits the form, uploading each file in the queue and sending the form data all at once.</p> <p><strong>Server Side Part:</strong></p> <p>You'll probably be <em>submitting</em> the form to an ASPX file or ASHX handler. I prefer using an ASHX handler since they're more light-weight. Both will allow you access to the <code>HttpContext</code> or the <code>HttpRequest</code> object. First, you'll need to check <code>context.Request.Files.Count</code> to make sure files were posted:</p> <pre><code>if (context.Request.Files.Count &gt; 0) // We have files uploaded { var file = context.Request.Files[0]; // First file, but there could be others // You can call file.SaveAs() to save the file, or file.InputString to access a stream } </code></pre> <p>Obtaining the other form fields should be just as easy:</p> <pre><code>var formfield = context.Request["MyFormField"]; // Some form field </code></pre> <p>You can also write results back to the client, such as a JSON encoded description of any resulting errors:</p> <pre><code>context.Response.Write(response); // Anything you write here gets passed in to onUploadSuccess </code></pre> <p>I think that should get you started anyway!</p>
 

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