cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Export Media items with source files

Former Member
0 Likes
2,946

Hi everyone, I'm trying to export some Media items in this way

 "#% impex.setTargetFile( ""AnixterMedias.csv"" );"
 INSERT_UPDATE Media;$contentCV[unique=true];code[unique=true];mime;realfilename;@media[translator=de.hybris.platform.impex.jalo.media.MediaDataTranslator][forceWrite=true]
 "#% impex.exportItems(""SELECT {P:pk} FROM {Media! as P}, {CatalogVersion as CV}, {Catalog as C} WHERE {P:catalogversion}={CV:PK} AND {CV:catalog}={C:PK} AND {C:id}='$contentCatalog' AND {CV:version}='$version'"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1  );"
 

That's working well so far, but now I need to get also the actual file for each media as part of the .zip file which is gotten when exporting content, how can I achieve that? I'm using Hybris 6.5

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

I did it just performing the export through the Backoffice, you can use the same script and then you will have 2 buttons, one for downloading the csv file and another to download the actual source files of the Media items

Answers (0)