I have the necessity to upload on my PHP web server 2 images.
The first is a preview of what the clients got (canvas snapshot)
The second is the original uploaded image.
I achieved this with something like
- FileChooser plugin > Save file to local blob storage (like blob://http://myurl/myfile.png)
- Sprite on screen > Set from URL (from local HTML5 blob storage)
- Some check stuff (like filesize, mime etc...)
- Canvas snapshot
- Ajax Post with "Canvas="&CanvasSnapshot&"&FileName="&CustomName
- PHP file that handle the file
$img1 = $_POST['Canvas'];
$img1 = str_replace('data:image/jpeg;base64,', '', $img1);
$img1 = str_replace(' ', '+', $img1);
$data1 = base64_decode($img1);
$success = file_put_contents($file1, $data1);
Now I have the file in the HTML local blob storage, the canvas preview on my server [b]BUT[/b]
How do I upload the original, uncompressed, file?