Problems with file uploads
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Problems with file uploads
I have this config in my config/shop.php file:
However, I can upload all kind of images, when creating a product. Even PDF or Zip files. Why doesn't the Shop prevent those uploads?
Also, is there an option to rename the upload folder and filename (other name instead of "/preview/" and random filename without extension)?
Code: Select all
...
'controller' => [
'common' => [
'media' => [
'standard' => [
'files' => [
'allowedtypes' => [
'image/gif',
],
],
'preview' => [
'allowedtypes' => [
'image/gif',
],
],
],
],
],
...
Also, is there an option to rename the upload folder and filename (other name instead of "/preview/" and random filename without extension)?
Re: Problems with file uploads
This configuration are the mime types that are allowed when converting images, not the mime types allowed for uploads (that can be everything).
Yes, if you extend and overwrite the media controller class:
https://github.com/aimeos/aimeos-core/b ... #L340-L362
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: Problems with file uploads
Is there any logic in place to control the upload? Where/how would that be done? I managed to upload a .php file, which is potentially very dangerous.This configuration are the mime types that are allowed when converting images, not the mime types allowed for uploads (that can be everything).
Perfect, thanks a lot!Yes, if you extend and overwrite the media controller class:
https://github.com/aimeos/aimeos-core/b ... #L340-L362
Re: Problems with file uploads
You can whitelist the mime types you want to allow here:
https://github.com/aimeos/aimeos-core/b ... #L455-L499
https://github.com/aimeos/aimeos-core/b ... #L455-L499
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