Permalink
Browse files

[-] BO : fixed import images

  • Loading branch information...
vAugagneur committed Jan 3, 2013
1 parent 865c98e commit 8d7196daf3b39d280c631882f0e3ebe473233d07
Showing with 4 additions and 4 deletions.
  1. +4 −4 controllers/admin/AdminImportController.php
@@ -642,12 +642,12 @@ protected static function split($field)
if (is_null($separator) || trim($separator) == '')
$separator = ',';
do $uniqid = uniqid(); while (file_exists(_PS_UPLOAD_DIR_.$uniqid));
$tmp_file = file_put_contents(_PS_UPLOAD_DIR_.$uniqid, $field);
$fd = fopen($temp, 'r');
do $uniqid_path = _PS_UPLOAD_DIR_.uniqid(); while (file_exists($uniqid_path));
file_put_contents($uniqid_path, $field);
$fd = fopen($uniqid_path, 'r');
$tab = fgetcsv($fd, MAX_LINE_SIZE, $separator);
fclose($fd);
unlink($tmp_file);
unlink($uniqid_path);
if (empty($tab) || (!is_array($tab)))
return array();

15 comments on commit 8d7196d

@kashibabu

This comment has been minimized.

kashibabu replied Jan 5, 2013

Thank you for this modification.
Your modification certainly worked. There is a "but" however.
Multiple images for one product-id were now succesfully imported via csv import (so far so good).

But my harddisk indicator light now never stops blinking /
the computer seems to keep processing/wrting/spinning something/somehow
this for an unreasonble amount of time.
.
Like there is some "unsolvable" routine going on somewhere.
To avoid a possible diskfailure, I resolved to stopping the Xampp server (localhost)
and stopped Mqsql to bluntly terminate the ongoing routine.
It just didn't stop.....

Any ideas for betterment?

Regards,
Kashi

I am working with the latest prestashop version 1.5.3.

This was the content of the 1601upload.csv (that worked now):

id;Name*;Image URLs (x,y,z,...);Delete existing images;ID / Name of shop
1601;1601 ~ NEW WRAP AROUND;http://localhost/prestashop/upload/1601-1.png,http://localhost/prestashop/upload/1601-2.png,http://localhost/prestashop/upload/1601-3.png,http://localhost/prestashop/upload/1601-4.png;1;1

@salaguillaume

This comment has been minimized.

salaguillaume replied Jan 7, 2013

Hi, thank's for you fix proposal. coul'd i ask question ?

Why white the split history on disk ? that's just explode all my programmation certitudes :D

thank's for your response ...

@xavixaus

This comment has been minimized.

xavixaus replied Jan 14, 2013

This works for me on prestashop 1.5.3 in http://www.venlotodo.com.

@veptune

This comment has been minimized.

veptune replied Feb 2, 2013

It doesn't work for me :(
I use 1.5.3 like you.
I change your file with your info, i double check, but the problem still :(
Category always Home and image not uploaded

@veptune

This comment has been minimized.

veptune replied Feb 2, 2013

Finally my problem was related to a folder permission. Thanks :)

@jimmymurillo

This comment has been minimized.

jimmymurillo replied Feb 20, 2013

I finally make my products are placed in the category, but the images are not placed with the products, I am Using prestashop 1.5.3.1, I used the code (adminimportcontroller.php), and on this way I could put the categories with the products, but images dont show.
i try in all way to resolve this problem, I have my images in the folder ../images-udl/xxxxxx.jpg, I tried without the slash ..images-udl/xxxxxx.jpg, not work
Could some body show me how I can fix this problem.
Thank you.
Jimmy Murillo
Bolivia

@michelink69

This comment has been minimized.

michelink69 replied Mar 1, 2013

to jimmymurillo

you will have to click into regenerate the miniatures and move the images. This buttons are located in preferences/images.

Works ;)

@RorySlingo

This comment has been minimized.

RorySlingo replied Mar 8, 2013

Thanks, this fix worked for me in 1.5.3

@jimmymurillo

Did you try using the image's full URL in the CSV?

eg. instead of ../images-udl/xxxxxx.jpg, use http://www.yourdomain.com/images-udl/xxxxxx.jpg

I tested with both types of paths in one CSV and the products with relative paths did not successfully import the images, only those with the full paths.

@urecheatu007

This comment has been minimized.

Contributor

urecheatu007 replied Mar 8, 2013

I allways use the full url for images, and it works every time.

@slindy

This comment has been minimized.

slindy replied Mar 15, 2013

Thank tou.

@ChristopheBoucaut

This comment has been minimized.

Contributor

ChristopheBoucaut replied Mar 25, 2013

THX !

@lobros

This comment has been minimized.

lobros replied Mar 27, 2013

Veptune!!! Please post your solution, I think I have the same problem!!!!! Folder Permissions!!! Because Locally my store works well!!! but in the server I have this problem!

So it is folder permissions, but what folders????

@lobros

This comment has been minimized.

lobros replied Mar 27, 2013

Can I live a private message to veptune guys??? how can I do this??? I'm new here

@norcalpress

This comment has been minimized.

norcalpress replied May 6, 2013

I am stuck and need help with a solution. I was running Prestashop 1.5.3 and one click upgraded to 1.5.3.1 - my issue is with photo uploads and product images not displaying. I am using Carano theme. And in themes/images I renamed images to small_carano instead of small_default originally before upgrade in 1.5.3. - so photos would be visible in different browsers. This was working fine. Now with upgrade as I inspect element of broken photos, the link path says http://bigfussmusic.com/images/p/62/small_default - no photo appears- when I edit the HTML in chrome and change to small_carano and close edit window, picture appears!! But of course this is not permanent fix. How do I change these permanently and fix this issue. The same thing is happening with the other images like medium and large etc. I am not sure I gave you the correct link above but you can see for yourself at http://bigfussmusic.com under what's new. Thank you to anyone taking the time to read this and to whoever would offer help, in advance.

@15ruso

This comment has been minimized.

15ruso replied Jul 16, 2013

I have problem than lobros and veptune, i don´t solve this :( I was rewrite admininmportcontroller, but it don´t help me :( Can I help mi guys please?

Please sign in to comment.