Jump to content

Cant upload images...


Lewis
 Share

Recommended Posts

hello all, 

i recently moved a processwire site from cpanel hosting to virtualmin hosting.

everything is working fine, except of the upload of featured image in an article.

Field type is image, and i have disabled overwriting of existing files.

when i try to upload an image, it goes to 100%, i save the page but i cant see the image.

when i search the filesystem for the specific filename, i can see it inside /site/assets/files/1703/...

 

Can anyone help me with this issue ?

 

 

Link to comment
Share on other sites

1 hour ago, jmartsch said:

According to your information it seems your file is uploaded. Where is the image not visible? In the admin (backend) or frontend?

nowhere is visible..

in the first screen shot, you see that theoretically the file is uploaded, i save, i reload the page and there is no file..

 

Screen Shot 2017-04-25 at 21.58.27.png

Screen Shot 2017-04-25 at 21.58.59.png

Link to comment
Share on other sites

2 hours ago, LostKobrakai said:

Can you show us the code where the images are used in your template and/or the markup, which does get rendered?

this is supposed to be the rendered page with the image..

http://www.1055rock.gr/news/plastic-machinery-single-different-days-charlatans-johnny-marr/

below you can see some screenshots of the usage of field "image" with title "Featured Image" in the template..

Screen Shot 2017-04-25 at 22.02.10.png

Screen Shot 2017-04-25 at 22.01.35.png

Link to comment
Share on other sites

1 minute ago, Lewis said:

where can i find this setting to try ?

First check your php version with php --version, because this directive was removed in PHP 7.0

If you're on PHP 5.x, you must have root access to php.ini to change this setting.
On debian based systems (tried on Ubuntu) you can find the location of php.ini using

locate php.ini

and edit fpm/php.ini (if you're using nginx or some other http server/proxy)
or cli/php.ini if you're using cli version (apache)

  • Like 1
Link to comment
Share on other sites

@Lewis, php configuration is handled by /home/dim1055/etc/php5/php.ini file, add that directive to end of the file. In case it doesnt work, (probably wont as you're on PHP v5.6.30) this STO answer seems to answer why it didnt work/how to get it working.

https://magento.stackexchange.com/a/93490

FYI, you shouldn't expose phpinfo() to public, it reveals sensitive/potentially dangerous info about your system.

Link to comment
Share on other sites

4 minutes ago, abdus said:

@Lewis, php configuration is handled by /home/dim1055/etc/php5/php.ini file, add that directive to end of the file. In case it doesnt work, (probably wont as you're on PHP v5.6.30) this STO answer seems to answer why it didnt work/how to get it working.

https://magento.stackexchange.com/a/93490

FYI, you shouldn't expose phpinfo() to public, it reveals sensitive/potentially dangerous info about your system.

i did the change in /home/dim1055/etc/php5/php.ini but upload images still is not working..

i revealed my phpinfo just for debug purposes.. :)

Link to comment
Share on other sites

(Did you restart PHP service?)

Any other pages or templates have working image uploads?

When you delete the pagefiles directory (/site/assets/files/213 etc), can PW create and upload the file inside?

  • Like 1
Link to comment
Share on other sites

3 hours ago, abdus said:

(Did you restart PHP service?)

Any other pages or templates have working image uploads?

When you delete the pagefiles directory (/site/assets/files/213 etc), can PW create and upload the file inside?

i restarted the services..

i deleted the directory, PW created and uploaded the file, but i cannot see it neither in backend, nor in frontend..

i noticed strange dates in uploaded files, as you see in the attached file.. 

Screen Shot 2017-04-26 at 03.34.39.png

Link to comment
Share on other sites

Are there any javascript errors on upload (check with browser's dev tools)? Any other pages or templates have working image uploads or is this behaviour specific to this page only? Image is smaller that 2M (looks it is)? Any clues in PW log files? Try chmod -R 777 /site/assets/files/1234 to see if there are permissions problems.

  • Like 1
Link to comment
Share on other sites

6 hours ago, Lewis said:

i restarted the services..

i deleted the directory, PW created and uploaded the file, but i cannot see it neither in backend, nor in frontend..

i noticed strange dates in uploaded files, as you see in the attached file.. 

Screen Shot 2017-04-26 at 03.34.39.png

Shouldn't files be owned by www-data user & group? In most setups (unless overriden) web service and php run as www-data (and user and files should be owned by www-data group). What does php run as in your case?  https://unix.stackexchange.com/a/30191

Also what does date return in bash? and date() in PHP?

Link to comment
Share on other sites

2 hours ago, jmartsch said:

Another problem, or maybe THE problem is, that you seem to not have GD lib installed. As you can see on https://processwire.com/about/requirements/ this is required. Install it, and I think your problem is gone.

this is the answer :) GD was the problem, since it was a fresh install, i hadn't installed it...

thank you all for the support !!!

 

  • Like 1
Link to comment
Share on other sites

I have a similar but different issue on uploading multiple image files using the drag and drop facility or selecting them the 'Choose File' button. The files upload fine and the matching number of thumbnails appear in the Images section. However, when I Save the page, all but the first of the uploaded file thumbnails disappear. All the original image files and asssociated api generated image files are present in assets/files subfolder where you would expect them. GD2 lib is installed in PHP 7.  This happens on all the PW sites I have on this host. I don't use another so can't compare. It has been like this for me since I took up PW 5 years ago on successive versions . It's not a huge issue in that I can upload the image files one at a time and then all is well. Any hints or clues as to why this happens and how to fix it?

Link to comment
Share on other sites

On 28.4.2017 at 7:01 PM, joebaich said:

The files upload fine and the matching number of thumbnails appear in the Images section. However, when I Save the page, all but the first of the uploaded file thumbnails disappear.

The thumbnails are not generated server side on the initial upload, but directly in the browser from the local filesystem. So that's not really a success indicator of any sorts. Try inspecting the ajax requests for the file uploads with the browser dev tools.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...