Jump to content

Undefined Error When Trying To Upload Product Images


Recommended Posts

Hi All,

 

I am having a problem when trying to upload images to products. I get a red ribbon at the bottom of the images upload page that simply says 'undefined error' when trying to upload an image. I've not added any images for a while, so this could be due to an upgrade to 1.5.6.1 not so long ago.

 

I have searched around the forums a bit and people have been suggesting that it is something to do with mod_sec settings on the server. I have contacted my host (Krystal Hosting) who have looked into the problem for me and have advised that they are seeing a problem with the requests for the site appearing to be malformed.

 

I have attached a Modsecurity audit log entry for one such interception by my host if that helps anyone decipher the issue.

 

Any help would be much appreciated,

 

Many Thanks =)

modsec.txt

Link to comment
Share on other sites

I have had my host look into this issue quite thoroughly for me and they have finally tried disabling mod_sec completely for me and the issue still continues to be present.

 

The technician at my host says 'the requests being made by this webpage are badly formed, and I suspect are so broken that it is causing the receiving script to give the error it is doing, and thus failing to capture any meaningful image data.'

 

Any further ideas?

Link to comment
Share on other sites

one thing you can check is your php settings for file uploads.  this helped another poster in that their php.ini settings were blocking file uploads...

 

The easy way is to load this free module

http://www.prestashop.com/forums/topic/278164-free-module-display-php-environment-phpinfo-back-office/

 

then under tab info_configuration check settings:

file_uploads On

upload_max_filesize (size)

max_file_uploads (more than 1 generally 20)

post_max_size (This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.)

Link to comment
Share on other sites

I have loaded the free module and check the settings you suggest and they all seem to be OK:

 

file_uploads: On

upload_max_filesize: 100M

max_file_uploads: 20

post_max_size: 100M

 

Although the post_max_size is the same as the upload_max_filesize I am not trying to upload a file anywhere near 100M - it is less than 1M.

Link to comment
Share on other sites

OK, I have managed to find a work around to this error, but it is obviously not ideal. I was reading through the post here looking for some solutions and noticed someone said that the problem did not occur for them under internet explorer.

 

I tried internet explorer to no avail and was still getting the same error. Someone in the thread above noted that it worked fine for them on Windows XP using internet explorer. I am using Windows 7 with the latest update of IE. If I add my domain to the compatibility view settings in IE, I have no issue uploading images!

 

Can anyone offer an explanation of this? Is this a bug in PrestaShop that I need to open a support ticket for?

  • Like 1
Link to comment
Share on other sites

Link to comment
Share on other sites

Thank you for the extra links to other threads for the same issue El Patron. It seems this is a much more common issue than it should be, but with many obscure reasons and workarounds linked to it...

 

When reading through this thread I came across another work around that suits me better - if i log in to my BO using the URL without the www prefix I can upload images in all browsers without an issue, despite PrestaShop giving the error: "You are currently connected under the following domain name inkfinity.co.uk. This is different from the domain name set in the "SEO & URLs" tab. If this is your main domain, please change it now."

 

I can live with this error if it gives me a workaround to the show-stopping "undefined" error when uploading images...

 

Can anyone explain why the above workaround works though?

  • Like 1
Link to comment
Share on other sites

 

I am using Windows 7 with the latest update of IE. If I add my domain to the compatibility view settings in IE, I have no issue uploading images!
 
 
well I did this but didn't have to do it before, but IE will now let me upload successfully ----- FOR NOW!
 
no such option in firefox
 
jh
Link to comment
Share on other sites

Unfortunately I have not come across any new workarounds but the two above continue to work for me, so they are the best I have at present. I still think there is something broken behind the scenes that PrestaShop developers should be aware but I don't know whether to log it on the repository or not. My host continues to inform me it is something to do with malformed url's.

Link to comment
Share on other sites

  • 2 weeks later...

one thing you can check is your php settings for file uploads.  this helped another poster in that their php.ini settings were blocking file uploads...

 

The easy way is to load this free module

http://www.prestashop.com/forums/topic/278164-free-module-display-php-environment-phpinfo-back-office/

 

then under tab info_configuration check settings:

file_uploads On

upload_max_filesize (size)

max_file_uploads (more than 1 generally 20)

post_max_size (This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.)

 

Hello Sir,

 I tried to check about php configuration and installed the module you suggested above, but i am having error in "INFO_CONFIGURATION". 

I have attached a screenshot too.

 

Trying to resolve image upload "undefined" error, but no luck yet.

 

Any kind of help will be really appreciated. 

 

Thank you very much.

Link to comment
Share on other sites

 

Tried all the methods told in above links ... but no success :( 

Link to comment
Share on other sites

  • 1 month later...

I have the same problem.  I have updated to version 1.5.6.2 and i cannot upload images as it tells me that there was an error copying your picture. 

 

I have tried chrome and firefox and also cleared caches, deleted histories etc.

 

I have another instance of prestashop running, which is a backup of my previous installation.  In version 1.5.4.1 there are no issues, from either browser. 

 

Any solutions to this problem?

Link to comment
Share on other sites

I have the same problem.  I have updated to version 1.5.6.2 and i cannot upload images as it tells me that there was an error copying your picture. 

 

I have tried chrome and firefox and also cleared caches, deleted histories etc.

 

I have another instance of prestashop running, which is a backup of my previous installation.  In version 1.5.4.1 there are no issues, from either browser. 

 

Any solutions to this problem?

 

Hi,

 I was resolved with this issue. 

This issue was in extension of Web Hosting Manager (WHM)

If you have access to WHM, follow this tutorial    http://forums.cpanel.net/f5/enable-install-mbstring-module-158165.html     to turn on the mbstring module.

If you don't have access to WHM, ask your hosting provider to turn on the "mbstring extension" for you.

Edited by aun4some1 (see edit history)
Link to comment
Share on other sites

Hi,

 I was resolved with this issue. 

This issue was in extension of Web Hosting Manager (WHM)

If you have access to WHM, follow this tutorial    http://forums.cpanel.net/f5/enable-install-mbstring-module-158165.html     to turn on the mbstring module.

If you don't have access to WHM, ask your hosting provider to turn on the "mbstring extension" for you.

I am running prestashop on my own server, and mbstring is already enabled.

 

my phpinfo file has the screenshot

 

 

Am i doing something wrong?

post-567507-0-56031000-1393105903_thumb.jpg

Edited by nikolaosp (see edit history)
Link to comment
Share on other sites

I am running prestashop on my own server, and mbstring is already enabled.

 

my phpinfo file has the screenshot

 

 

Am i doing something wrong?

so, it appears that the simplest explanation is always the last one you check...

 

Although my site's folder was owned by www-data user and group, some subfolders of img folder where owned by another user.

 

Don't know how this could happen, but there you go...

 

It works now as it should .

Link to comment
Share on other sites

so, it appears that the simplest explanation is always the last one you check...

 

Although my site's folder was owned by www-data user and group, some subfolders of img folder where owned by another user.

 

Don't know how this could happen, but there you go...

 

It works now as it should .

 

we were also wanting to know if there was any change to out file system, including permissions, so I wrote this:

http://www.prestashop.com/forums/topic/303132-module-prestavault-malware-trojan-virus-protection/

Link to comment
Share on other sites

×
×
  • Create New...