Import from Excel stops running if image is not found on server

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Hello,

Has anyone found a reasonable workaround / fix for this issue:

When using the "Import from Excel" option to bulk import products, if the image specified in column "BR" (Picture1) (e.g. C:\HostingSpaces\accountname\domain.com\wwwroot\content\images\thumbs\sample-image.jpg
) of the spreadsheet is not found in the appropriate folder on the server the import stops running and shows the following error:

Could not find file 'C:\HostingSpaces\accountname\domain.com\wwwroot\content\images\thumbs\sample-image.jpg'.

What I'd like is for the import to keep running and either automatically use the default "No Image Found" file (i.e. "noDefaultImage_300.gif") or, use no image or, ideally, provide a list/report of items that no image was found for or not add the item but provide a list of items that were not added/imported due to no image found on the server.

Has anyone already handled this?  I have over 5000 items to add and I know that there will be plenty of items that will have this issue and restarting the import each time will be a pain.

Thanks in advance.

nopcanuck
10 years ago
Oh man how annoying.  Clearly the biggest obstacle in setting up Nopcommerce is the product import.  Looks like my life is going to be a living hell for the next week trying to import products.

Has anyone come up with a solution to get flawless imports from a CSV or XML file?
10 years ago
Actually, the import works very well.  It is only when a file name (for a product image) is entered into column "BR" on the spreadsheet doesn't exist on the server that there is an issue.

nopcanuck
10 years ago
If you're a developer, you could custom code a Try/Catch around the picture code.  I did it a for a customer (a long while back) .  I logged the errors/picture-filename to System>Log so that I knew which ones failed.
10 years ago
We encountered the same problem once.

There is need to change the export/import logic that if some picture is missing - to skip this one and go on - but do not to stop the whole process.
10 years ago
I ran into this issue as well. There is a quick fix. Just change this piece of code to make it continue if an image is missing.

In \Libraries\Nop.Services\ExportImport\ImportManager.cs – change:

if (String.IsNullOrEmpty(picture)

to

if (String.IsNullOrEmpty(picture) || !File.Exists(picture))
10 years ago
Thanks...

Your solution worked perfectly on our 2.65.

:-)
10 years ago
so, when you say the solution worked perfectly, is that to imply that the fix allows images to upload successfully? and where the heck is the libraries folder?

what i found after looking around was that my system was saying "user not granted permission to apppool\whatever directory"

is this an actual fix for it? doing a bulk import is KEY to this whole process - especially when i have 15K of product to update - if i can't do images, i'm screwwwwwed. i'm using 3.0 and would really like a solution/work-around/fake out whatever.....

here's what my errors read - but the list is long so i'll give you an example.
The 'IIS APPPOOL\MORA' account is not granted with Modify permission on folder 'C:\002WebRoot\MORA\App_Data'. Please configure these permissions.
The 'IIS APPPOOL\MORA' account is not granted with Modify permission on folder 'C:\002WebRoot\MORA\bin'. Please configure these permissions.
The 'IIS APPPOOL\MORA' account is not granted with Modify permission on folder 'C:\002WebRoot\MORA\content'. Please configure these permissions.

if these are fixed will it resolve the issue of not uploading an image?

p.s. i triple checked the path on my local and it is indeed correct. I still got this: Could not find a part of the path 'C:\omix_images\image\11001.01.jpg'.

i'm also guessing that given the lack of permissions everywhere - that once i resolve this - i'll have other problems to address. i sure hope not. i gotta get this thing rollin'!!
10 years ago
no additional info/feedback on this one? if i can juuuuuuuust get this img thing squared away i can fiiiiiinally start getting some product on my site. i hope anyway.....
10 years ago
You have dropped the images into appropriate folder on the server and referenced them in the corresponding column/cell on the spreadsheet?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.