Handling plupload's chunked uploads on the server-side
In the end I used the code from official example bundled with plupload-1.5.2 (examples/upload.php):
http://github.com/moxiecode/plupload/blob/master/examples/upload.php
plupload - send another request parameter with uploaded file
The first step would be to add a handler to the BeforeUpload
event.
Then, if you are using multipart, you can change the uploader settings to dynamically set different multipart params:
plupload_instance.bind('BeforeUpload', function (up, file) {
up.settings.multipart_params = {fileid: file.id}
});
(warning: this example overrides any and all multipart_params, you can play it smarter than that by just setting fileid)
if you are not using multipart, your only options would be to pass the argument as a header, or to manually add the param to the URL for each file (these 2 options should also be done within BeforeUpload).
Note that when not using multipart, plupload will add the name
and chunk
params to the URL after any URL you already set for the uploader, for each file, so this is where extra params go.
Save data into database with a multiuploader
Create function that moves uploaded file into your photo folder and inserts it into database then iterate over multiple files received by POST and call that function on each one. This is for not repeating code.
How to upload large files above 500MB in PHP
Do you think if increasing upload size limit will solve the problem? what if uploading 2GB file, what's happening then? Do you take into consideration the memory usage of such a script?
Instead, what you need is chunked upload, see here : Handling plupload's chunked uploads on the server-side
and here : File uploads; How to utilize "chunking"?
Related Topics
Parse JSON String Contents into PHP Array
PHP Using Preg_Replace:"Delimiter Must Not Be Alphanumeric or Backslash" Error
Php.Exe' Is Not Recognized as an Internal or External Command, Operable Program or Batch File
Hide Variable Product Dropdown That Has a Unique Variation Selected by Default in Woocommerce
Executing PHP Code Inside a .Js File
Saving Wav File Recorded in Chrome to Server
PHP + MySQL + Stored Procedures, How to Get Access an "Out" Value
Jquery Using Ajax to Send Data and Save in PHP
Encryption/Decryption of Form Fields in Cakephp 3
Parse Error: Syntax Error, Unexpected '(', Expecting ',' or ';' In
Warning: MySQL_Num_Rows() Expects Parameter 1 to Be Resource, Object Given
Check If a Row Exists Using Old MySQL_* API
Handling Big User Ids Returned by Fql in PHP
How to Load CSS File in Codeigniter