How to import/create images via Media Manager Class
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!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
How to import/create images via Media Manager Class
Hello
I can create new Media items via
$newMediaItem = $mediaMgr->create();
and add them via a new list item to the desired product - so far, so good
But how do I have to deal with the images itself?
Where should I store the Images?
What should I enter via $newMediaItem->setUrl()?
Is it possible, to enter real URLs to a remote location or is the value to set in the url attribute only a local/relative path?
If iI add Images manually via Backend, they are stored under /httpdocs/uploads/tx_aimeos/files/ and then two levels with strange numbers/letters (0-f)
Thanks for your help and kind regards, Michael
I can create new Media items via
$newMediaItem = $mediaMgr->create();
and add them via a new list item to the desired product - so far, so good
But how do I have to deal with the images itself?
Where should I store the Images?
What should I enter via $newMediaItem->setUrl()?
Is it possible, to enter real URLs to a remote location or is the value to set in the url attribute only a local/relative path?
If iI add Images manually via Backend, they are stored under /httpdocs/uploads/tx_aimeos/files/ and then two levels with strange numbers/letters (0-f)
Thanks for your help and kind regards, Michael
Re: How to import/create images via Media Manager Class
You should store them in a subdirectory of ./uploads/tx_aimeos/. Then, they are part of the 'fs-media' file system and can be accessed by the Aimeos code. Use setUrl() to set the path to the file relative to the ./uploads/tx_aimeos/ directory, e.g.
./uploads/tx_aimeos/images/myproductimage.jpg -> images/myproductimage.jpg
You can use full qualitifed URLs, a relative path or a "data:" URL.
The files are distributed over several directories for performance reasons. If you have several thousand files in one directory, many filesystems slow down, so there are 256 subdirectories the files are distributed in.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: How to import/create images via Media Manager Class
hum, I store the image in a subdirectory as mentoined and set the url relative to uploads/tx_aimeos/
In the backend i see the media item of the product but there is no image shown.
In the backend i see the media item of the product but there is no image shown.
Re: How to import/create images via Media Manager Class
Check in the browser console, which URL is used.