How to import asset files?

#How to import Asset files into Magento 2

Since the 100.6.0 version of the Akeneo Connector for Magento 2, you can import files from assets into Magento 2.

File import from Assets is only available for Akeneo version 4.0 or superior

Connector parameter Magento information
Import New File Asset Yes or No

If set to no, no new files will be downloaded but the already imported attributes won't be erased.

All files will be downloaded in the 'pub/media/akeneo_connector/asset_files/' folder

Connector parameter File Asset Collection Attribute
Akeneo Asset Manager File Attributes List your Akeneo PIM File Asset Collection attribute codes

As Magento 2 cannot handle file upload attributes, the connector will download Akeneo asset files and insert the link into the attribute, formatted as JSON.

JSON example:

{
          "asset_file_1": "akeneo_connector/asset_files/f/i/file-1.pdf",
          "asset_file_2": "akeneo_connector/asset_files/f/i/file-2.pdf"
        }
        

The connector will only import asset files with a main media of the media type "PDF" or "Other".

The connector will import asset files from both media file and media link attributes.

The localizable and scopable dimensions of your Akeneo Asset Collection File attribute and the Akeneo Asset Family main media attribute will be automatically managed by the connector.

Since the 100.6.0 version of the Akeneo Connector for Magento 2, the connector will transform asset collection attributes to text areas in Magento 2 in order to handle JSON content for asset collection file attributes.

If you already imported an asset collection file attribute before upgrading the connector to version 100.6.0, you will have to delete the previously imported attribute and import it again in order to transform it into a text area.

Connector parameter Magento information
Download Akeneo External File Asset Link Yes or No

This parameter allows you to choose whether to locally download or not the Akeneo file assets with the media type "Media Link".

If set to No, the Akeneo file asset links will be added to the JSON.

If set to Yes, the Akeneo external file assets will be downloaded to Magento 2 and the local path will be added to the JSON. Also, if set to Yes, the Akeneo External File Asset Link Download parameter will be displayed.

Setting this option to Yes might affect the performance of the import due to the downloading time of the Akeneo file assets.

Connector parameter Magento information
Akeneo External File Asset Link Download Always download all assets or Download only assets with different filename

As it is not possible to detect that an external file has been modified, this parameter allows you to choose between two download modes for assets with a main media attribute of "Media Link" type:

  • Always download all assets: This option will always download all assets with an external media link.
    • This option will handle any changes on your external assets but might slow down your imports.
  • Download only assets with different filename: This option will not download previously downloaded assets from an external media link based on their filename.
    • This option will not be able to import an external asset that has been modified but that keeps the same filename than a previously imported asset.