You can set max_file_size filter in your config and show a warning to the user.

Plupload supports drag and drop and sorting, but we do not have directly available method to insert file at a specified position. Although you can re-order the queue as you find appropriate manually. Uploading will happen in the order that you will end up with.

It is possible in Plupload 3.

54

(14 replies, posted in General discussion)

@Bagee, third argument in FileUploaded handler is server response. You can't do: alert(response), since it's an object, but you can do: console.log(response); and see its contents in the console tab of the developer tools.

.jpg is different from .jpeg, so simply add jpeg to the list of allowed extensions:

filters : {
        max_file_size : '4mb',
        mime_types: [
            {title : "Image files", extensions : "jpg,jpeg,gif,png"} // <--
        ]
},

1. How to get the filename, cause it is not there when i save the file?

What do you mean it's not there? Can you post your server-side code?

57

(10 replies, posted in General discussion)

SC.accessToken() is not available anymore in recent version of SoundClound JS SDK. I've thrown together an example of how it can be done directly without SDK.

http://play.plupload.com/g6aJ2/20

Not sure what you mean by local uploaded file. If it is already uploaded you could use PHP GD library for example to acquire images width and height and send it back, with the ok response to FileUploaded handler.

Or if you want to make it locally, you can use our Image wrapper from mOxie. Check this thread for example.

You confuse couple of things here. You cannot use native browser API with those file objects that you receive in your FilesAdded handler. But you can make this work if you use our wrappers, like this:

init: {
 
  FilesAdded: function (up, files) {
      plupload.each(files, function(file, i) {
          var img = new mOxie.Image;
          img.onload = function () {
              // access image size here using this.width and this.height
          };
          img.load(file.getSource());
      });
  }
}

60

(3 replies, posted in General discussion)

S3 doesn't support mere chunking, or how they call it - multipart upload (which is confusing). Every chunk must be of a specific size and signed in a special way. It can be done, but has to be custom-coded, we do not support it out of the box. There are some add-ons in development that should make it easier, but they are not yet production ready.

The only thing in Plupload that makes difference between regular files and images is client-side resizing feature. If you have it in the config, remove it and see if it helps. If it - doesn't, then it is something on your server that corrupts the images.

Plupload supports renaming the files, and even auto-generating unique ones, but it doesn't touch extensions. One thing you could probably do, is write your own file re-namer and hook it onto BeforeUpload event.

62

(2 replies, posted in General discussion)

Plupload is front-end file uploader, nothing else. PHP handler that we include in the package is only an example. You cannot control file permissions from the Plupload. One thing you could do is to set "read-write permissions for everybody" in your handler after you move uploaded files from the temp folder to the destination.

chmod($filePath, 0666);

Not sure what you expect, of course local upload will be much faster than that to the external hosting server. 115mb is pretty big for any connection, so it will take some time to upload. You cannot control it from the config, it is matter of the throughput capability of your internet connection. You could disable chunking, it should make your upload faster... a bit. Also you are using deprecated version of the Plupload. I'd recommend you an upgrade.

64

(2 replies, posted in UI Widget)

This might help: File Filters.

65

(2 replies, posted in UI Widget)

Resize happens just before the upload, not on file selection. You can alter options after init using uploader.setOption() method if you are using Core API, or $('#uploader').plupload('option') method for UI Widget.

66

(1 replies, posted in UI Widget)

You can change file.status to plupload.QUEUED manually and reset file.loaded to 0. On next uploader.start() file will be picked up for the upload again.

67

(1 replies, posted in Core API)

You can't. Sorry. One file requires at least one request.

68

(1 replies, posted in Core API)

Can you post your config?

You haven't include the code for UI widget (jquery.ui.plupload.min.js). It comes with the package.

There's an undocumented event Browse, try to hook on it.

You can upload a file on any type and image of any resolution. The constraint exists only for client-side resizing, which is not used by core media uploader in WordPress.

Can you post your config?

73

(1 replies, posted in Core API)

In general post_max_size should be larger than upload_max_filesize - maybe three times post_max_size.

And what exactly doesn't work. Are you getting an error of some kind?

You better do it in BeforeUpload, which is triggered for every file that is going to be uploaded. You can even cancel the upload by returning false from the handler.

Also use uploader.setOption('multipart_params', obj), rather then trying to alter multipart_params directly (the latter is now deprecated).

$("#uploader").pluploadQueue({
    runtimes: 'html5,flash,silverlight',
    url: 'https://<?php echo $s3_bucket; ?>.s3.amazonaws.com/',
    max_file_size: '100mb',
    multipart: true,
    file_data_name: 'file',
    multiple_queues: true,
    filters : [
        {title : "MP3 files", extensions : "mp3"},
        {title: "M4A files", extensions: "m4a"}
    ],
     
    flash_swf_url : '<?php echo base_url(VENDOR) ?>/plupload/Moxie.swf',
    silverlight_xap_url : '<?php echo base_url(VENDOR) ?>/plupload/Moxie.xap',
    init: {
        BeforeUpload: function(up, file) {
            //Replace unwanted characters with "_"
            var new_name = file.name.replace(/[^a-z0-9\-.]+/gi,"_");

            var multipart_params = {
                'key': '<?php echo $this->ion_auth->user()->row()->username . "/"; ?>' + new_name,
                'Filename': '<?php echo $this->ion_auth->user()->row()->username . "/"; ?>' + new_name,
                'Content-Type': 'audio/mpeg',
                'Content-Disposition' : 'attachment',
                //'acl': 'private',
                'success_action_status': '201',
                'AWSAccessKeyId' : '<?php echo $s3_accessKeyId; ?>',
                'policy': '<?php echo $s3_policy; ?>',
                'signature': '<?php echo $s3_signature; ?>'
            };

            up.setOption('multipart_params', multipart_params);
        }
    }
});

Do you want to let the user change resize options just once (before Plupload is instantiated) or you want it to be interactive?