on ‎2018 Apr 23 12:36 PM
Hi,
We have some objects with Media attributes, which should be able to contain both videos (.mp4/.webm) and images (.png/.jpeg/.jpg/.webp). When importing media using impex, we can import al of these file extensions and all of these files are correctly displayed.
Another requirement is that these attributes should be modifiable via Smartedit (e.g. a video should be replaceable with another video or an image). Now, uploading .jpg and .png works, but when we try to upload .mp4 (or .webm or ...) in Smartedit, we get the error that the 'Selected file type is invalid'.

I've tried modifying the seFileValidationService.js file of the cmssmartedit extension by adding the required extensions to the ACCEPTED_FILE_TYPES-line (line 31), but this doesn't seem to work, even after an ant clean all + server restart.
Does anyone know how we should modify these file type restrictions?
Thanks in advance!
Request clarification before answering.
Have you found solution ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It helped me to add ability to upload GIF files in smartedit:
public VALID_IMAGE_MIME_TYPE_CODES: string[] = [
'FFD8FFDB',
'FFD8FFE0',
'FFD8FFE1',
'474946383761',
'474946383961', // gif magic number
'49492A00',
'4D4D002A',
'89504E470D0A1A0A',
'3C3F786D6C207665', // svg magic number'3C73766720786D6C' // svg magic number];
Hi everyone, i am facing issue(selected file type is invalid) while uploading .svg image from (UPLOAD IMAGE TO LIBRARY) but i am able to add png,jpg images.
Does anyone know how we should modify to achieve the above...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michiel,
Besides modifying "seFileValidationService.js" you should also modify "seFileMimeTypeService.js" and add the magic number for the file type you would like to accept.
Both these .js files are processed and concatenated into "cmssmarteditContainer.js" which resides in the webroot. So after modifying the "seFileValidationService.js" and "seFileMimeTypeService.js" you will need to have the hybris platform also run the 'grunt build tasks'. To do so you would need to run 'ant npminstall' and after 'ant clean build' that will result in an updated "cmssmarteditContainer.js" file.
It is a kind of dirty trick to achieve this, but it will work. The best approach will be building a customized smartedit editor.
Regards, Emil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michiel, I am getting same error "Selected file type is invalid".After changed both file "seFileValidationService.js" and "seFileMimeTypeService.js" .I am uploading also mp4 file type. Is there something need to change somewhere. Please suggest to me. It would be much appreciate .
BR, Omkar
Hi Michiel,
I am having same issue with uploading files in smartedit, Did you find any solution for that if yes please share.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.