Jump to content

[SOLVED] 1 error 1. an error occurred while copying image


Recommended Posts

1 error

1. an error occurred while copying image


This seem to be a popular error I have search but no answer does anyone know how to upload a image i have tried gif jpg etc but nothing the file is not big


It is running on a windows server and i can upload files via .asp so i guess the permission is ok

any ideas would really be much appreciated

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 months later...
  • 2 months later...

This issue has something to do with PHP Safe Mode.
I had this problem for a couple of days now and ave been testing a lot to locate the error.
The weard thing is that the first 4 products I created went through with no problems. Then I tried to copy a product with image and then this problem started to occur. I was no longer able to add images so I started the investigation.
I checked all the folder permissions and everything inside the IMG folder, including the IMG folder itself has CHMOD on 777 so this was not the problem. The IMG folder also has the TMP folder and the P folder and they're both CHMOD 777.
Then I tried changing the upload_tmp_dir in php.ini to a folder accessible for PHP in my web root folder and suddently it worked again! BUT when trying to add an aditional image to a product it all started over again!
Then I updated my server software (I run a Synology 211+ server) and after the update it all worked fine. But as standard after an update of the Server the php.ini has PHP_Safe_mode set to off. After changing it to On, it all started again and I was not able to upload or add additional images to my products. But when safe mode is off, it all works great!
I have to run with Safe Mode On because there was a lot of hacking of my server before then and Safe mode keeps the hackers out!
in previous versions of prestashop I didn't struggle with this issue even when the safe mode is turned on so I expect that it is somehow the new image file structure who gives me this problem when safe mode is on.

Does anyone know a good solution for this issue? As I can see there are many people strugleing with the same issue and the creators of prestashop denies that it is a bug so I expect that this can only be solved by the users who has the problem with no help from the prestashop team.

Maybe I need to change something on my server (paths, etc) to make it work with safe mode on? Please advise me, thank you!

My server runs:
PHP Version 5.3.6
Apache version: 2.2.17
Prestashop version: 1.4.3.0

Link to comment
Share on other sites

I had a client who had trouble with images after upgrading to PrestaShop v1.4.3. Switching to the new image system seems to have fixed the issue. Follow my article here to switch to the new image system. Also, you need to regenerate your .htaccess file afterwards for the images to work. The instructions don't say that in PrestaShop v1.4.3.

Link to comment
Share on other sites

Thank you for the answer Rocky, but I have to tell you that it makes no difference. The error still occurs, even after switching to the new file system and turning legacy off.
The only thing that works for me is to turn off PHP safe mode so I am doing this when adding products and turning it back on when done.
I am lucky to have access to my php.ini file as I host on my own server but many of other users uses public servers and doesn't have this opportunity and most of these servers are using PHP safe mode on. So if it is possible we need a solution/mod/extension for safe mode image uploading.
I also found out that another function that doesn't work with safe mode turned on is the new language installation part in ps 1.4. In safe mode it can't extract the language packs but when safe mode is turned off it installs without any problems.

Link to comment
Share on other sites

  • 1 month later...

Thank you for the answer Rocky, but I have to tell you that it makes no difference. The error still occurs, even after switching to the new file system and turning legacy off.<br/>The only thing that works for me is to turn off PHP safe mode so I am doing this when adding products and turning it back on when done.<br/>I am lucky to have access to my php.ini file as I host on my own server but many of other users uses public servers and doesn't have this opportunity and most of these servers are using PHP safe mode on. So if it is possible we need a solution/mod/extension for safe mode image uploading.<br/>I also found out that another function that doesn't work with safe mode turned on is the new language installation part in ps 1.4. In safe mode it can't extract the language packs but when safe mode is turned off it installs without any problems.

 

Finally! The issue has been solved.

I have installed the new Prestashop 1.4.4.0. Here there is a check for safe mode before you activate the new image system. To reverse to the old system where you can upload images with Safe_mode turned on just turn on "Use the legacy image filesystem" in "preferences --> Products". After that go to "Preferences --> Image" and regenerate the thumbnails.

Now all new image uploads will be done with the old image system which works for me with safe_mode = On

 

EDIT: Automatic language installation still doesn't work. I get an "Archive cannot be extracted."-error when Safe_mode is on. But this issue must be for another forum thread :) And is not that urgent for me too as you can download them and manually install it by adding them to your ftp server directly.

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
×
×
  • Create New...