#1 July 14, 2017 11:00am

doon.mok
Member
Registered: May 6, 2015
Posts: 141

Image browse error

Hello,

I'm having an issue when trying to Browse for an image. I keep on getting the errors

Image uploaded (image_2016_01.jpg) did not meet the minimum size of 135x170 pixels.
An invalid file was uploaded. Valid file types: JPG, GIF, PNG.

Even though the image is larger then 135x170 pixels and and an jpg. When I click Upload, it works fine with no errors. Just get this error when I Browse.
Here are the things I tried with no success to fix the issue.
- /public_html/site/files folder permission 777
- /tmp folder permission 777
- created a php file to create/write  to site/files folder to make sure permissions work fine.
- checked Developer > Site Status and it was all green

Does the Upload and Browse go to different folder locations? I can't figure out why one works and other doesn't?
Currently on BigTree 4.2.18 and uploading to S3.

Thanks

Offline

#2 July 17, 2017 1:16pm

doon.mok
Member
Registered: May 6, 2015
Posts: 141

Re: Image browse error

I am still having this issue but did some more digging.

I disconnected Amazon S3 and used local storage and was able to upload images through Browse/Upload without any issues. So I believe the permissions are correct on the folders.
Went to S3 and check the permissions on the images and they are readable.
Opened core/inc/bigtree/admin.php, this is where the processImageUpload function is located and did some debugging. It creates a $temp_name and its /home/rfucli5/public_html/site/files/temp-596cfd3850a31.img. It also gets the minimum requirements such as width, height, type for error checking. When it gets these requirements, they are empty and that is why the errors.

The temp_name has an extension of .img instead of gif, jpg or png but coming from S3, it is a jpg.

If anyone has any insite, I am not sure why the requirements are coming back as empty and temp_name has extension of .img?

Offline

#3 July 19, 2017 3:35pm

doon.mok
Member
Registered: May 6, 2015
Posts: 141

Re: Image browse error

I noticed when it does fail, it adds the resource:////
img of resources

Just in case image doesn't show up: http://imgur.com/a/IX1oT

Offline

#4 July 24, 2017 8:55am

doon.mok
Member
Registered: May 6, 2015
Posts: 141

Re: Image browse error

I figured out the issue and this is what I did to fix it.
Doing some print_r on certain variables for the processImageUpload function in admin.php, I was getting a warning message.

Warning: copy(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in...
Warning: copy(.jpg): failed to open stream: no suitable wrapper could be found in ...

I added allow_url_fopen = on; in the /../site/php.ini file but it was still not working. I had to enable it in the CPanel under MultiPHP INI Editor. It wrote allow_url_fopen = On in their cpanel php.ini file located in the root of the folder.

I left allow_url_fopen = on; on both php.ini files just in case.

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.