Hi,
EDIT: I noticed that previously I didn't include the Inflate on the PHP side, I'm including it now.
I've done that recently for my own chunked-uploads (uploading a big file in smaller chunks).
Here's the code for both Javascript and PHP, if you got any questions, anything is unclear or need an advice on that code or how to accomplish this task, please reach me here on Freelancer (we can chat by Skype or email too):
//Javascript:
//It's creating the FormData object to send base64 data
var formData = new FormData();
[login to view URL]('filedata', data);
//The jQuery ajax() function:
$.ajax({
url: '/api/upload_base64',
processData: false,
contentType: false,
method: 'POST',
data: formData,
success: function (response) {
[login to view URL]('Data has been successfully sent!')
}
})
//The php for the /api/upload_base64 route:
<?php
//Decoding
$filedata = base64_decode(gzinflate($_POST['filedata']));
//Saving at the $filename path
file_put_contents($filename, $filedata, FILE_APPEND);
Kind regards,
Tomasz.