We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Generate thumb image witch multiple upload

Hi when uploading a file does not perform multiple thumbnails or sends files to the directory, ie sends only one of the 5 and minitury does not generate, please help because this is going to go crazy without

<?php $image = new \Phalcon\Image\Adapter\GD("files/" . $filename);
                            $image->resize(210, 140);
                            $image->save("files/thumbnail/thumb_" . $filename); 
?>

works well upload files, 5 files is 5 Loading a file and sends it as I add just generowanei thumbnails already sends only one file



43.9k

Hi Jarek,

Are you sure your form is well written for sending multiple files at once ?

You may read this post for example to check that: https://stackoverflow.com/a/10164816

Or with Chrome debuging console (or any other tool, I've got no participation at all in Google ;-)), watch the POST request parameters.

If multiple files are sent, you will have to do a "foreach" through the $_FILES object loop for resizing your images like it is explained here: https://docs.phalcon.io/en/latest/reference/request.html#uploading-files

hope this helps



8.5k

Already have solved your problem, and the problem was that when I put some pictures once it kicked it into one photo and not doing thumbnails

https://github.com/boxbillinggit/Phalcon_class/tree/master/Library/Phalcon/Imagegen/Adapter