Hi,
I am using your upload class, I want to save the uploaded image twice.
1. Original size
2. Rezied size
However, when I save the file once, it will get deleted from the tmp, so it is not possible anymore to save it also as resized.
Original save: $upload->save_to('./uploads/' . $mdc . $upload->name);
Resized save: $upload->save_image_resized('./uploads/r_' . $mdc . $upload->name, 400);
The resized save will fail because the tmp file has been removed while saving the original.
Can you help with this?
Upload class - save file twice
Re: Upload class - save file twice
I'm just brainstorming here but wouldn't it be possible to duplicate the tmp file?
/Edit; I have no idea, this might not work.
$original_tmp = $_FILES['file']['tmp_name'] $resize_tmp = $_FILES['file']['tmp_name']and then just use the respective clone?
/Edit; I have no idea, this might not work.
Re: Upload class - save file twice
I replied to the comment, but for the same of completeness...
save_image_resized() has an option to save the full size image as well as the resized one, so you could do
save_image_resized() has an option to save the full size image as well as the resized one, so you could do
$upload->save_image_resized('./uploads/r_' . $mdc . $upload->name, 400, 0, './uploads/' . $mdc . $upload->name);