PHP Warning: imagejpeg(../public/images/50/00f0f_bkscVGdtmn5z_0t20CI_50x50c.jpeg): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/mystore/engine/Image.php on line 76
[25-Aug-2022 17:38:20 UTC] PHP Warning: imagejpeg(../public/slider_pics_thumbnails/50/00f0f_bkscVGdtmn5z_0t20CI_50x50c.jpeg): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/mystore/engine/Image.php on line 76
Image upload fails
4 years ago
4 years ago
#1
4 years ago
#2
Hi frocco,
Assuming your php install has the gd extension loaded in php.ini
You can check this by going to a terminal and into the where php installed
you should see gd listed as one of the PHP modules
if not, you can enable it by editing your php.ini -> search for 'extension=gd' and remove the leading semicolon, the save and restart your Apache server
Another thought is to check your write access, this is the Save method in Image.php that is falling over on line 76.
Also, may also want to do a json($config, true); just before
to see if all the paths and names are as expected, as I see in your code above it's fragments of the submit_upload_picture() method
Assuming your php install has the gd extension loaded in php.ini
You can check this by going to a terminal and into the where php installed
you should see gd listed as one of the PHP modules
if not, you can enable it by editing your php.ini -> search for 'extension=gd' and remove the leading semicolon, the save and restart your Apache server
Another thought is to check your write access, this is the Save method in Image.php that is falling over on line 76.
Also, may also want to do a json($config, true); just before
to see if all the paths and names are as expected, as I see in your code above it's fragments of the submit_upload_picture() method
4 years ago
#3
Hi DaFa, I checked the permissions and everything looks ok.
gd is loaded.
The record id is 50, and if I create that directory under images, the upload works.
Permissions are read/write on my mac.
I even switched to xampp and it still fails unless I create the record id folder of 50.
gd is loaded.
The record id is 50, and if I create that directory under images, the upload works.
Permissions are read/write on my mac.
I even switched to xampp and it still fails unless I create the record id folder of 50.
4 years ago
#4
Ok, no probs wanted to rule out any of the usual stuff.
Has the module been generated by the Desktop app or is it custom code you did?
I noticed the pictures are going to the public folder:
So the missing '50' or id folder is where it fails, as you said it works if you create the folders manually?
This is the code desktop app generates to create the folders, has your module got this or something like it?
Has the module been generated by the Desktop app or is it custom code you did?
I noticed the pictures are going to the public folder:
So the missing '50' or id folder is where it fails, as you said it works if you create the folders manually?
This is the code desktop app generates to create the folders, has your module got this or something like it?
4 years ago
#5
Thanks DaFa for your help.
I had overlooked the create folder function and assumed the upload took care of it.
It is working fine now.
I had overlooked the create folder function and assumed the upload took care of it.
It is working fine now.