Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload_resize bug #9

Closed
erikdemarco opened this issue Apr 13, 2019 · 3 comments
Closed

Upload_resize bug #9

erikdemarco opened this issue Apr 13, 2019 · 3 comments

Comments

@erikdemarco
Copy link

turn on php error reporting

try this script here:
=> http://formr.github.io/upload-files/#a-complete-example

you will get Warning: imagejpeg(/www/formr/uploads/thumbnails//tn_20M3N2Qr1MRs0zmwkl7Yq4Q9hjZR818W.jpg): failed to open stream: No such file or directory in C:\wamp64\www\httpformr\class.formr.php on line 1368

see this double trailing slashes => '/www/formr/uploads/thumbnails//'?

Why there is double trailing slashes?

@timgavin
Copy link
Member

Just remove the trailing slash after thumbnails

Change this

$form->upload_resize = array(
    'thumbnail' => '100,100,tn_,/www/formr/uploads/thumbnails/,90'
);

To this

$form->upload_resize = array(
    'thumbnail' => '100,100,tn_,/www/formr/uploads/thumbnails,90'
);

@sanoj26692
Copy link

sanoj26692 commented Jul 12, 2019

even after changing to this

$form->upload_dir = 'uploads'; $form->upload_rename = 'hash'; $form->upload_accepted_mimes = 'images'; $resize = array( 'thumbnail' => '100,100,tn_,/thumb,90', ); $form->upload_resize = $resize;

i get following error

Warning: imagejpeg(/thumb/tn_CY3KXHmZy07389T8x0Rbjk5dGn2yzqLp.jpg): failed to open stream: No such file or directory in C:\Users\Amin\Documents\NetBeansProjects\TEST\form\class.formr.php on line 1407

@timgavin timgavin reopened this Jul 12, 2019
@timgavin
Copy link
Member

Put the full path to the thumb directory, not just /thumb

This is the example given in the docs:

$form->upload_resize = array('thumbnail' => '100,100,tn_,/htdocs/uploads/tn/');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants