Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to save Images with two different dimensions using plupload
    text
    copied!<p>I am using Plupload plugin to upload multiple images as we have option to resize images on the client side and I would like to upload images with original size and save them to seperate folder and the resized images to another folder.</p> <p>Can anyone suggest me how to procee further? Here is my code:</p> <pre><code>Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim chunk As Integer = If(context.Request("chunk") IsNot Nothing, Integer.Parse(context.Request("chunk")), 0) Dim fileName As String = If(context.Request("name") IsNot Nothing, context.Request("name"), String.Empty) Dim fileUpload As HttpPostedFile = context.Request.Files(0) Dim uploadPath = context.Server.MapPath("~/uploads") Using fs = New FileStream(Path.Combine(uploadPath, fileName), If(chunk = 0, FileMode.Create, FileMode.Append)) Dim buffer = New Byte(fileUpload.InputStream.Length - 1) {} fileUpload.InputStream.Read(buffer, 0, buffer.Length) fs.Write(buffer, 0, buffer.Length) End Using context.Response.ContentType = "text/plain" context.Response.Write("Success") End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property </code></pre> <p>This my script code:</p> <pre><code>&lt;script type="text/javascript"&gt; $(function () { // Setup flash version $("#flash_uploader").pluploadQueue({ // General settings runtimes: 'flash', url: 'upload.ashx', max_file_size: '10mb', chunk_size: '1mb', unique_names: true, filters: [ { title: "Image files", extensions: "jpg" } ], // Resize images on clientside if we can resize: { width: 800, height: 600, quality: 90 }, // Flash settings flash_swf_url: 'js/plupload.flash.swf', init: { StateChanged: function (up) { // Called when the state of the queue is changed if (up.state == plupload.STOPPED) { $("#btnSubmit").removeAttr("disabled"); } } } }); var uploader = $('#flash_uploader').pluploadQueue(); uploader.bind('FileUploaded', function (up, file, res) { $('#showfilelist').append("&lt;div id=" + file.id + "&gt;&lt;a href='uploads/" + file.target_name + "' target='_blank'&gt;&lt;img src='uploads/" + file.target_name + "' border='0'/&gt;&lt;br&gt;" + file.name + "&lt;/a&gt;&lt;br&gt;(" + plupload.formatSize(file.size) + ") &lt;span&gt;&lt;/span&gt;&lt;/div&gt;"); }); }); &lt;/script&gt; </code></pre>
 

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