Magento2: Magento 2 import products with images using CSV Issue

Created on 11 Jul 2017  路  15Comments  路  Source: magento/magento2



I'm trying to import a CSV file with new products that contain local images but I am receiving the error:

Preconditions


  1. Magento 2.1.7

Steps to reproduce

  1. Create simple product with image.
  2. Export this product to CSV.
  3. Try to import product with an image using csv.

Expected result


Product Import Successful.

Actual result


Got following error :
Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s):

ImportExport Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.1.x Reproduced on 2.2.x Reproduced on 2.3.x bug report

All 15 comments

I have the same problem while I do have images in the pub/media/import folder and in the csv the images are written like this: 123456.jpg (without the path)

Description updated.

@mayankzalavadia, thank you for your report.
We've created internal ticket(s) MAGETWO-75633 to track progress on the issue.

I would like to work on this ticket.

Hi @Jens-S
I've sent you an invitation to join Magento Team on public GitHub. Could you please accept the invitation?

Sorry, but I want to pass this ticket back.

Hello @okorshenko

I also would like to give my contribution on Magento. So, can you please send me an invitation to join Magento Team on public GitHub.

@mayankzalavadia invitation sent. Would like to work on this issue?

Yes I Would like to work on this issue.

Cannot reproduce it on 2.2 dev.
Are you filling Images File Directory field from the admin/import tool?
If so, try not to fill it and use the CSV file exported as-is.

PS: if you still encounter issues i'd like to take care of this ticket.

Can confirm. Can鈥檛 reproduce in 2.2 and 2.3.

This issue was moved to magento-engcom/import-export-improvements#83

Hello Community!

I was able to reproduce the same error Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): when tried to import products with images. The images were located and really existed on 3rd party website, not in local foder.

The issue was related to HTTP Header, which my images returned when code asked for HTTP status per each image url.

The code expects status 200 OK, but in my case it was 301 Moved Permanently and that assumed as "Image Missing".

Hints:
MagentoFrameworkFilesystemDriverHttp::isExists()

if (strpos($status, '200 OK') === false) {
$result = false;
} else {
$result = true;
}

In our case we have done customization with following enhancement:
if (strpos($status, '200 OK') === false && strpos($status, '301 Moved Permanently') === false) {
$result = false;
} else {
$result = true;
}

Kind Regards,
Tolik

Same error 2.2.5
in my pub/media/import i have the file with 777 permission both on the folder and the file.
in my csv I have only file name.
err

Note : When a magento is behind a Proxy for example, this code is causing issue because get_header is not properly implemented
here MagentoFrameworkFilesystemDriverHttp.php : isExists mail have the possibility to pass a $context variable to be able to pass for example a proxy to the get_header, which allow context to handle this problem
note : the context is passed on the function of the class....
Today the only solution is to override this class, which is bad solution

Was this page helpful?
0 / 5 - 0 ratings