I have 2 custom media types: a custom folder type that inherits folder and a custom image type that inherits from image.
The purpose is to put some costraints for the editor and have some custom resize based on the image type.
My problem is related with multiple upload: when I upload images from the custom folder it fails to create the custom image (I suppose it tries to create standard images and fails because they're not allowed as children).
How can I extend the multiple upload feature? Thank you
Your folder where you want to upload custom images needs to allow both images and custom image types. This way uploader will not block images to upload and this code will do the magic after upload.
Basically it changes normal image type to custom image type. Limitation is that this works only if you need one custom image type because it takes first one which is not Image. If you need to support multiple custom types for mass upload you will have to do saom small rework of this code.
Upload custom media from folder (umbraco 6.x)
Hi all,
I have 2 custom media types: a custom folder type that inherits folder and a custom image type that inherits from image.
The purpose is to put some costraints for the editor and have some custom resize based on the image type.
My problem is related with multiple upload: when I upload images from the custom folder it fails to create the custom image (I suppose it tries to create standard images and fails because they're not allowed as children).
How can I extend the multiple upload feature? Thank you
Hello,
I don't know how to extend the default multiple upload feature, but you can disable it and replace it with a custom version of MFU: http://our.umbraco.org/projects/website-utilities/multiple-file-upload/bugs/20286-Support-for-custom-Media-Types
I've also done that in the DAMP Gallery.
Jeroen
Thank you for the feedback :)
There is a pretty simple workaroud for this, but you will have to do some coding :)
As much as I tried to change behaviour of mass uploader, nothing worked, so I decided to do some work right after upload.
In your Application handler constructor, add a handler for MediaService.Saved event like the following:
Your folder where you want to upload custom images needs to allow both images and custom image types. This way uploader will not block images to upload and this code will do the magic after upload.
Basically it changes normal image type to custom image type. Limitation is that this works only if you need one custom image type because it takes first one which is not Image. If you need to support multiple custom types for mass upload you will have to do saom small rework of this code.
Please let me know if this works for you.
@ Dejan you're a legend
Code worked exactly as is, I'm creating different media image types with different crops, this works amazingly well
Works like a miracle! Thanx!
is working on a reply...