CSV product import: Downloads

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

CSV product import: Downloads

Post by Moritz » 27 Feb 2019, 13:49

Hello,

Is there a possibility to attach download files to a product when importing a CSV?
For images I can use 'media.url' and the relative path to it.
I didn't find anything similar for download files...

Grettings

Moritz
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: CSV product import: Downloads

Post by aimeos » 01 Mar 2019, 11:18

It's possible but requires a bit more understanding how Aimeos saves downloads internally. They are "hidden" attributes of type "download" with the relative URL inside the secure file system (usually ./uploads/tx_aimeos/.secure/).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

Re: CSV product import: Downloads

Post by Moritz » 08 Mar 2019, 11:50

So I should store the download file into my secure upload folder?
Is there any rule that I have to consider? Like the naming or folder structure?

Can you tell me which of the following values should be filled for the import and where do I place the relativ download path?

Code: Select all

    array(
    	'attribute' => array(
    		0 => 'attribute.typeid',
    		1 => 'attribute.type',
    		2 => 'attribute.code',
    		3 => 'attribute.label',
    		4 => 'attribute.position',
    		5 => 'attribute.status',
    	),
    )
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: CSV product import: Downloads

Post by aimeos » 08 Mar 2019, 17:28

There's not required nameing for the secure folder. We store md5 hashes like "a0...f9.jpg" so we are sure there's no potential security issue.

You should use:
- attribute.type = "download"
- attribute.code = "a0...f9.jpg"
- attribute.label = "myfile.jpg"
- attribute.position = 0
- attribute.status = 1
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

Re: CSV product import: Downloads

Post by Moritz » 20 Mar 2019, 14:44

That doesn't work because the download is stored as normal attribute instead of hidden attribute.
How can I import it as hidden attribute?
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: CSV product import: Downloads

Post by aimeos » 21 Mar 2019, 12:59

Add "product.list.type" => hidden to your mapping and your data:
https://aimeos.org/docs/Developers/Cont ... #Attribute
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

Re: CSV product import: Downloads

Post by Moritz » 21 Mar 2019, 13:41

Perfect, that works.
Thank you!
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

Post Reply