Description
I'm trying to import product images with very long names.
295744_20200804070722_tanzteppich_colorx_150_plus_1004222_16330_chroma_blau_schw_150cm_lfm.jpg
There is a limit in Magento of 90 characters which I don't fully understand.
All unix filesstems support 255 characters, Windows as well, the value column in catalog_product_entity_varchar is 255 characters, the value column in catalog_product_entity_media_gallery is also 255 characters.
The limit of 90 characters is annotated in vendor/magento/framework/File/Uploader.php with the following comment:
// account for excessively long filenames that cannot be stored completely in database
I don't know of any database column less than 255 characters. So the hard limit could be much higher, like 240 characters (the filename in the media gallery will be prepended with the dispretion path of /2/9/ which is 5 extra characters.
Tested on Magento 2.3, on Magento 2.4 there is the same limitation.
Preconditions (*)
- Magento 2.4-develop
- create a simple product import csv file and prepare a very long filename for the product image. You can use exampled provided along with this bug report.
Steps to reproduce (*)
- put a very long named product image into var/import/images/ as described in the guide here https://docs.magento.com/user-guide/system/data-import-product-images.html
- In the product csv specify the very long image filename for a product image attribute (like base_image).
- Import the product csv file in the Magento backend using System > Data Transfer > Import. For import settings use:
Entity Type: Products
Import Behaviour: Add/Update
Validation Strategy: Stop on Error
Example CSV file: sample_long.csv.txt
Expected result (*)
- Product will be imported without problems and have product image assigned
Actual result (*)
-
"Check Data" passes, while Import itself will fail due to the fact the product image cannot be saved because of exceeded length
-
The error message is misleading as it says: "1. Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 1"
-
When using a shorter image name, import works.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status