Jump to content

Can't upload Images .gif, .jpg, .png


Recommended Posts

Everytime I try to add a product to my catalog my image will fail to upload.
And I get the following error.

image format not recognized, allowed formats are: .gif, .jpg, .png

So I started checking out what could cause the trouble, my first conclusion was something on the server is preventing the MIME types from being checked, could be PHP.INI file. Just to be sure there wasn't any restriction on uploading, I installed a simple upload script from tizag and it worked just fine...

The solution is probably getting rid of the code that checks the MIME types in Prestashop (v 1.3.6). Problem is I've been looking for hours and I still can't find the code that checks the MIME types. If there's somebody out there that knows where I can locate this code within Prestashop, please response...

thanks in advance.

Any other solutions are welcome... (site is running on shared linux server)

Link to comment
Share on other sites

I cannot give you any syntax or examples but i do know you can set MIME types in the .htaccess file

if you search online for MIME Types and .htaccess you might find an answer

Also you might want to check for php error logs created in the admin directory (it might be elsewhere) and this could also give you some help. again do google for turn php error reporting on.

the obviuos one, have you tried other picture files off your hard drive rather than just a few from the same batch. i have had jpegs in the past only photoshop would open.

Link to comment
Share on other sites

It's probably not a permission problem I changed all permissions to 777 for the /img directory and all subfolders. this includes the /tmp and /p folder

Now I really don't know what's causing the trouble I tried all kinds of resolution also... so it's not resolution related either.

Any clue on what else might be causing this new error?

Link to comment
Share on other sites

first of all restore your images.inc.php

depending on your server setup the folders should be set to 755 and files to 644 (this is if you have suphp or suexec installed, most large providers like justhost and hostgator have these on), setting to 777 is a security risk and can cause stuff to stop working.

an error occurred while copying image

this indicates there is something wrong with the file format. As i mentioned before gets some images of the net, not to large, jpg, png and gif and try uploading them. then check your php error log if it does not work.

Link to comment
Share on other sites

Hi,

I am having this same problem and nothing i seem to do is solving it.
Everytime i go to upload products with images the imagenever copies and i get the "Error copying image:" message after import.
I have checked all permissions, actual url's and exact wording along with filetype and size.
All should be perfect. i can see the image of where it is loaded on my host site if i navigate direct to it as well.
I have tried saving them in a different place and still get the same error.

I even went back to an older csv file to re-copy the url of a "generic picture" that uploaded fine several times a few days ago. Copied the link and popped it into a new csv file for a new product and that image now fails to upload when importing.

It's driving me crazy and i do not want to add images 1 by 1 per roduct after importing 1000+ products without an image.

Can anyone shed any more light on this matter please?

Chris

Link to comment
Share on other sites

I came up with one more possible issue... The GD library.... If you look in the img/p/ directory you see all those images resized at different sizes. Could it be that the GD library is turned of or is not properly configered or something in that direction.

Because finaly the GD library is responsible for the resize copies, so that could be the issue...

Link to comment
Share on other sites

I just solved this with the help of another user. Find your images.inc.php and cut the contents and paste it to wordpad and save it for emergency. Send me your email address and I'll send you a copy of what to replace it with. Worked great for me. If I can find the link where I got the replacement code from, I'll send you that instead.

Brian

Link to comment
Share on other sites

Thanks Troy,

Just checked my code and itis as your description.
The first line is commented, and the second is already showing what you suggest to alter it too.

I have noticed that when i do an import, then go look into the actual product from the category tab in BO.
When i goto the images tab of the product i can see the link it is trying to use, but no such file has been made within the img/p folder.

Link to comment
Share on other sites

OMG!
Think i have just solved this. Well, at least i have just uploaded 38 products all with pictures bar one that i actually typed the url wrongly.

I was comparing the first csv file that i had uploaded perfectly with no problems to the newer one i was trying so hard to get to work.
I noticed that the one that wasn't working, the url to the image as just www.mydomain.........
The original one i did with no problems started as the full http://www.mydomain........
So i altered all the newer file to include the http:// part and uploaded perfectly!

Thing is i copied the url from the old csv file to a new sheet to work on so it should have kept it the same but for some reason my excel decided to just knock off the http://

After days of banging my head against a brick wall, finally i think i can actuall upload my products. YAY

I hope this helps anyone else suffering too.

Thanks to all who tried to help too. Much appreciated.

Chris

Link to comment
Share on other sites

Everytime I try to add a product to my catalog my image will fail to upload.
And I get the following error.

image format not recognized, allowed formats are: .gif, .jpg, .png

So I started checking out what could cause the trouble, my first conclusion was something on the server is preventing the MIME types from being checked, could be PHP.INI file. Just to be sure there wasn't any restriction on uploading, I installed a simple upload script from tizag and it worked just fine...

The solution is probably getting rid of the code that checks the MIME types in Prestashop (v 1.3.6). Problem is I've been looking for hours and I still can't find the code that checks the MIME types. If there's somebody out there that knows where I can locate this code within Prestashop, please response...

thanks in advance.

Any other solutions are welcome... (site is running on shared linux server)





Hi,

I had the same problem with Prestashop 1.3.6 and has just SOLVED by asking my hosting provider to fix something in the php.ini file.

If your provider cannot help to fix the problem then you may consider to switch your hosting to www.xtrawebhosting.com because
Prestashop is an extremely great piece of shopping cart for your online business and I believes that you don't wanna loose it. My
provider has responded my request with 5mins of openning a help ticket and fixed the problem straight way, so impressed with their
services.

I'm now a happy PrestaShopper :)

Jack
Link to comment
Share on other sites

I dont think thats not an option, this site is not mine. And the client is running on budget. I just want to get this over with because im not a technical guy, i just happen to know php and a few server related things.

Please send me a real solution... And not some AD for another hosting provider...

  • Like 1
Link to comment
Share on other sites

I dont think thats not an option, this site is not mine. And the client is running on budget. I just want to get this over with because im not a technical guy, i just happen to know php and a few server related things.

Please send me a real solution... And not some AD for another hosting provider...




Hi suspectx86,

Please don't misunderstood as I'm not advertised for anyone elses and I'm not a technical person either, therefore I've
seek help from my provider with the php.ini setting. The problem have been fixed and I just thought to share it with
you and everyone whom have the same problem. I'm sure it is definitely something to do with the php.ini file because
I can now upload the images to my shop right after my provider did something in the php.ini file.

So, hope everyone to look into the php.ini file (if you know how coding it) or otherwise ask your provider to do the
setting for you...cheers!!

Jack
Link to comment
Share on other sites

I downloaded the php.ini file from here and put in my www folder and now I get a 500 Internal Server Error.

When I go to my admin folder the image uploader still gives me the same error an error occurred while copying image, so I just deleted it.



Nothing Solved and I'm starting to get frustrated



PS: Don't post anything about another hosting provider... Because it's not possible... and you will just piss me off.

Link to comment
Share on other sites

  • 2 months later...

Hi, well, it worked for me. I went on my hosts page and into my web, found the images.inc.php, backed it up just in case, replaced it with the one I suggested and hey presto, my photos went up without any problem. If it doesn't work for you, just put the old one back until someone comes up with something better.
Good luck

Brian

Link to comment
Share on other sites

  • 1 month later...
Any solution to this issue yet?? tried replacing images.inc.php but still the same issue..:(

That worked for me. I presume you're checked the size of the images you're trying to upload? I think the maximum size is 2000kb but the smaller the better. I can't think of anything else. On this site somewhere you'll find a link for the new images.php file that is to replace the one that comes with the program. Make sure you have the replacement file and are not uploading an old one. Afraid that's all the suggestions I have other than to suggest that it's really a difficult program to get your head around with many bugs in it, and I mean MANY.
Good luck.

Brian
Link to comment
Share on other sites

I downloaded the php.ini file from here and put in my www folder and now I get a 500 Internal Server Error.

When I go to my admin folder the image uploader still gives me the same error an error occurred while copying image, so I just deleted it.



Nothing Solved and I'm starting to get frustrated
If you get 500 INTERNAL SERVER ERROR, try switching you "in private browsing" on before you access your admin page.
Let me know if it works for you.

Brian

PS: Don't post anything about another hosting provider... Because it's not possible... and you will just piss me off.
Link to comment
Share on other sites

Nope didn't work for me. Here's to hoping that it works for others!

This is so frustrating!

I know I'll get over this hurdle eventually, I'm just hoping it's the first and only issue I'll encounter... blind optimism?


I'm afraid this is going to be the first of many, many hurdles you'll find within PS. A good freebie but the software has it's problems, and not much by way of free support.

Brian
Link to comment
Share on other sites

  • 2 weeks later...
OMG!
Think i have just solved this. Well, at least i have just uploaded 38 products all with pictures bar one that i actually typed the url wrongly.

I was comparing the first csv file that i had uploaded perfectly with no problems to the newer one i was trying so hard to get to work.
I noticed that the one that wasn't working, the url to the image as just www.mydomain.........
The original one i did with no problems started as the full http://www.mydomain........
So i altered all the newer file to include the http:// part and uploaded perfectly!

Thing is i copied the url from the old csv file to a new sheet to work on so it should have kept it the same but for some reason my excel decided to just knock off the http://

After days of banging my head against a brick wall, finally i think i can actuall upload my products. YAY

I hope this helps anyone else suffering too.

Thanks to all who tried to help too. Much appreciated.

Chris


my version is 1.4.1 and path started as the full http://www.mydomain.(with http://).......not www.mydomain (no http://).........
so still mad at this "an error ccurred while copying image"
still waiting replies...

Zoe
Link to comment
Share on other sites

  • 2 months later...
  • 8 months later...

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...