Store Images Import Unsuccessful

Dears

I am trying to import my products from a magento site, i used the CSV method but i can't import the images as the URLs end with .php . I get an error that i can't create/upload/rename a .php file to the site. I am about to import about 70,000 products so its impossible for me to download the images manually then upload those to the server. Please help.

URL Example :

			http://link.ecomsite.net/m2.php?ref=AAM1192
	
			http://link.ecomsite.net/m2.php?ref=AAP2664
	
			http://link.ecomsite.net/m2.php?ref=AAP2665
	
			http://link.ecomsite.net/m2.php?ref=AAP2666
	

Thank you

Yousef

Are you going to import it only once? Or periodically?

If only once, you can temporally allow uploading .php files.

1. Open app/functions/fn.images.php file and find the fn_attach_image_pairs function.

2. Replace this line:

    $detailed = fn_filter_uploaded_data($name . '_image_detailed', array('png', 'gif', 'jpg', 'jpeg', 'ico'));

with this one:

    $detailed = fn_filter_uploaded_data($name . '_image_detailed', array('png', 'gif', 'jpg', 'jpeg', 'ico', 'php'));

3. Open the config.php file and find $config['forbidden_file_extensions'] setting. Comment or remove the 'php' line.

4. Perform the import.

5. Roll back the changes in these 2 files.

If you want to import these images time by time, you need a special script which will get the file content by the URL, save it to the valid image file on server and import from this location (with permitted extension).


Oh, to import in the first case: the link should be in the 'Detailed image' column in csv file

Note that the detailed image will not work in the previewer if the mentioned code is applied.

Thumbnails will work only if you change the Settings -> Thumbnails -> Thumbnail format setting from same as source to GIF

Or thumbnails can also be imported from csv file ('Thumbnail' column). But

 $icons = fn_filter_uploaded_data($name . '_image_icon', array('png', 'gif', 'jpg', 'jpeg', 'ico'));

should also be widened to:

 $icons = fn_filter_uploaded_data($name . '_image_icon', array('png', 'gif', 'jpg', 'jpeg', 'ico', 'php));

Or thumbnails can also be imported from csv file ('Thumbnail' column). But

 $icons = fn_filter_uploaded_data($name . '_image_icon', array('png', 'gif', 'jpg', 'jpeg', 'ico'));

should also be widened to:

 $icons = fn_filter_uploaded_data($name . '_image_icon', array('png', 'gif', 'jpg', 'jpeg', 'ico', 'php));

In this case neither thumbnails nor detailed images will work since all images will be saved in the original format (php)

Thanks dears that worked perfectly

But the matter is that i will need to do this periodically. I have another question dears, can i import 70,000 product through the default admin import CSV or do cs cart have an alternative command or cron import system similar to that on magento's magmi ? as it will maybe get a php timeout block from the server.

Thank you

It works anyway. I tested.

It works anyway. I tested.

Try to open detailed image in the storefront

Try to open detailed image in the storefront

It opens. Funny.

It opens. Funny.

That's because the link is .php but when you download the file its extension is on jpg

It opens. Funny.

Hmm... I receive the following:

http://prntscr.com/9chlfb

Thanks dears that worked perfectly

But the matter is that i will need to do this periodically. I have another question dears, can i import 70,000 product through the default admin import CSV or do cs cart have an alternative command or cron import system similar to that on magento's magmi ? as it will maybe get a php timeout block from the server.

Thank you

Can you please help me with this issue, i tried several times to import but it stop at the first 5%. I then tried with 20000 and had the same issue.

Thanks

Check your timeout setting. Or split the file into several parts.

5% from 70k products is 3500 items. Try to import 3000 products at first

Ok dear i will , but i don't know if it would be the long term solution as i need to update those ever 2-3 days. I tried to change safari's timeout but with no luck.

Than you

I can only suggest to develop a cron script, which will import the csv file in console mode. But it would be better to develop a modification for this purpose.

For such cases we create a modifications which reload the page after N amount of products is updated (e.g. after each 5000 products). But RAM size on your server should allow to store the whole file in it

That may do it dear, how can i implement it

Dear i have a dedicated server with 12 mb ram , please tell me how can we do it

Dear i have a dedicated server with 12 mb ram , please tell me how can we do it

Do what? Cron script or page refreshing?