0

I'm using the Plupload library to upload audio files to my website from the front-end. Here is an example of my Plupload config:

var uploader = new plupload.Uploader({
    browse_button : 'browse',
    file_data_name : 'async-upload',
    multipart_params: {
        action : 'upload-attachment'
    },
    url : ajax_url,
    flash_swf_url : flash_swf_url,
    silverlight_xap_url : silverlight_xap_url,
    chunk_size : '200kb',
    max_retries : 3
});

My aim is to break files down into smaller 'chunks' whilst uploading. Plupload has built-in support for this.

My question

An example of server-side chuck handling is provided by Plupload. Does WordPress handle chunks server-side when uploading asynchronously or is this something I have to do myself?

Ref: http://www.plupload.com/docs/Chunking

1 Answer 1

1

To the best of my knowledge, no, the async-upload process on the WordPress side does not support chunking from plupload. You can find this code in /wp-admin/async-upload.php.

To handle the uploaded file, it calls the wp_ajax_upload_attachment() function, in the ajax-actions.php file. This function refers directly to the PHP $_FILES array, meaning that the file would be completely uploaded and saved to a tmp file by PHP before WordPress is invoked. Therefore chunking is not directly supported.

1
  • I got as far as async-upload.php myself but had trouble understanding the process from that point onward. You've made things a lot clearer with that explanation. Nov 14, 2014 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.