euniceyiewie Posted December 8, 2013 Share Posted December 8, 2013 Dear all, there was an error 'undefined' uploading product image in version 1.5.6.1 and it has nothing to do with the image sizes... Has anyone experience this before ? what am i suppose to do to get it fixed? Kindly advise and Thank you in advance ~ Link to comment Share on other sites More sharing options...
turnkeymaker Posted December 11, 2013 Share Posted December 11, 2013 Edit the js file "fileuploader.js" located in the "js" folder ( js/fileuploader.js ) Then go to line 1075 Replace xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); with these two lines of code xhr.setRequestHeader("Content-Type", "application/octet-stream"); xhr.setRequestHeader("processData", false); 5 Link to comment Share on other sites More sharing options...
pedropalamos Posted December 11, 2013 Share Posted December 11, 2013 It works! Thanks!! Link to comment Share on other sites More sharing options...
mudshark Posted December 14, 2013 Share Posted December 14, 2013 Also note LARGE images (per HxW dimensions) will cause this error. Link to comment Share on other sites More sharing options...
euniceyiewie Posted December 14, 2013 Author Share Posted December 14, 2013 finally, it works . Thanks a lot Turnkeymaker Link to comment Share on other sites More sharing options...
dockunz Posted January 9, 2014 Share Posted January 9, 2014 Didn't work. Link to comment Share on other sites More sharing options...
bacolodboy Posted January 10, 2014 Share Posted January 10, 2014 Worked good Thanks Link to comment Share on other sites More sharing options...
Pronux Posted January 13, 2014 Share Posted January 13, 2014 Didn't work in our PS 1.5.6.1. However, our hosting company is using cPanel 11 which has a "Web Application Firewall" that blocked image uploads (HTTP Error 406 was returned). Solution: Open cPanel web-interface and go to the admin page of the Web Application Firewall. There you should see the log entry(ies) of the failed upload(s). On the right side click on "Details" and on the popup chose "deactivate rule". Now wait 1 - 5 minutes until this change take effect. Hope it helps. Link to comment Share on other sites More sharing options...
blazedani Posted January 16, 2014 Share Posted January 16, 2014 Pronux, I have the same problem with Godaddy. replacing the info in fileuploader didn't work. And in Godaddy I can't find the firewall app you are talking about.Could you give me some more details? Thanks! Link to comment Share on other sites More sharing options...
Pronux Posted January 16, 2014 Share Posted January 16, 2014 Godaddy is not using cPanel 11 software, so my solution won't work in your case. Link to comment Share on other sites More sharing options...
blazedani Posted January 16, 2014 Share Posted January 16, 2014 just found out that it doesn't work on Chrome nor Safari, but is working on Firefox. weird... Link to comment Share on other sites More sharing options...
troyrob Posted January 18, 2014 Share Posted January 18, 2014 turnkeymaker's solution worked for me. Much props dude. Link to comment Share on other sites More sharing options...
websamosa Posted January 28, 2014 Share Posted January 28, 2014 in my cpanel no Web Application Firewall.. where can i found.. i'm stuck with image uploading error from last two days...plz help Link to comment Share on other sites More sharing options...
websamosa Posted January 28, 2014 Share Posted January 28, 2014 Edit the js file "fileuploader.js" located in the "js" folder ( js/fileuploader.js ) Then go to line 1075 Replace xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); with these two lines of code xhr.setRequestHeader("Content-Type", "application/octet-stream"); xhr.setRequestHeader("processData", false); it's not works for me plz help Link to comment Share on other sites More sharing options...
chenh Posted March 4, 2014 Share Posted March 4, 2014 Didn't work in our PS 1.5.6.1. However, our hosting company is using cPanel 11 which has a "Web Application Firewall" that blocked image uploads (HTTP Error 406 was returned). Solution: Open cPanel web-interface and go to the admin page of the Web Application Firewall. There you should see the log entry(ies) of the failed upload(s). On the right side click on "Details" and on the popup chose "deactivate rule". Now wait 1 - 5 minutes until this change take effect. cpanel.png Hope it helps. Hi, I have Cpanel 11, but I don't see or find the web application firewall. Link to comment Share on other sites More sharing options...
sttaq Posted November 3, 2014 Share Posted November 3, 2014 I am having the same problem. I uploaded my products using import wizard. A large number of products were uploaded with images but quite a few did not get their images. Since then whenever I try to manually upload an image I get this "undefined" error. On googling I found that some of the images that I intended to upload were too big in dimensions i.e. width x height. So I tried manually uploading smaller images but that still fails with undefined. I have also tried creating a new product and uploading an image and that does not work as well. The last thing I tried is to upload an image to a product which already has an image uploaded but unfortunately this also failed. I am quite sure that this is not a permission issue. Firstly, the script managed to upload a number of images and failed for a few. Secondly, I have checked all the permissions and have now set them to 777 i.e. complete read write access to everyone (not recommended). The only thing that I notice is in the Chrome console I get a 404 error. POST http://mysite/admin/ajax-tab.php?id_product=7&id_category=0&token=bcda…%5D=Product+Name&legend%5B2%5D=Product+Name&qqfile=product.jpg 404 (Not Found) fileuploader.js:1078 qq.extend._upload fileuploader.js:1078 qq.UploadHandlerAbstract.upload fileuploader.js:767 qq.FileUploaderBasic._uploadFile fileuploader.js:401 qq.FileUploaderBasic._uploadFileList fileuploader.js:392 qq.FileUploaderBasic._onInputChange fileuploader.js:375 qq.UploadButton.onChange fileuploader.js:312 (anonymous function) I don't see anything obvious in the cpanel that might not allow me to upload images and as earlier mentioned I have managed to upload a few already so I don't think that is not the case. I hope someone can help out. Link to comment Share on other sites More sharing options...
sttaq Posted November 5, 2014 Share Posted November 5, 2014 Edit the js file "fileuploader.js" located in the "js" folder ( js/fileuploader.js ) Then go to line 1075 Replace xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); with these two lines of code xhr.setRequestHeader("Content-Type", "application/octet-stream"); xhr.setRequestHeader("processData", false); just tried this and it seems to be working. thanks Link to comment Share on other sites More sharing options...
magali ferber Posted November 5, 2014 Share Posted November 5, 2014 Hi Everyone, I added SOLVED to the title of this thread. Please do the same whenever you solve issues on other threads, so we keep a nice and clean forum. Thanks! Link to comment Share on other sites More sharing options...
ariopars Posted March 5, 2015 Share Posted March 5, 2015 my problem not solve. i cant upload product image to prestashop 1.5.6.2 Link to comment Share on other sites More sharing options...
jfkproductions Posted April 20, 2015 Share Posted April 20, 2015 Hi to fix the issue in prestashop 1.5.6.2 xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); //kraai Du Toit fixed added this line // xhr.setRequestHeader("Content-Type", "application/octet-stream");//kraai Du Toit remove this line Link to comment Share on other sites More sharing options...
sc101 Posted November 11, 2015 Share Posted November 11, 2015 did not work !!! Link to comment Share on other sites More sharing options...
grafician Posted April 17, 2016 Share Posted April 17, 2016 1.5.6.2 here, did not work too! Link to comment Share on other sites More sharing options...
Recommended Posts