Apologies in advance for what seems a rather dumb question.
I’ve created a field to be of “media” type, placed it on a form, set display type to be “image_media”, set the field to be editable and have exited design mode.
I copy a png image to the clipboard, click on the field and paste. Nothing.
Yes, I’ve been able to import the image directly to the form, but I want the image in the media field. What am I missing?
When drag and drop, can I override the default behavior and trigger a method. Also can I get the dragged object’s reference. So if I drag a folder of files then I can loop through and create a new record for each files?
It’s a feature request that I asked a long time ago. That we, just before the drop, could fire a method so we can retrieve the filename, mimetype, etc.. and than fill the media field with the content.
The Media Manager bean will do what you want.
It allows you to drop files or folders onto a bean in your form.
The files are imported for you and mime-type prompting occurs when each file is dropped onto the bean.
Folder-imports do not prompt the user but instead make a best match based upon your mime-type table contents (a part of the Solution which ships with the bean/plugin).
There are 2 flavours of the bean:
import data to database record
import data to server file system with a dialog to choose the path on the server
A user typically places the 2 bean types side-by-side on a form for convenience.
In the case of option 2 you can choose to simply push the files up to the server without creating any records (a conveneience mechanism to get files uploaded to the server without wanting a record created to point to each of the contained media files).
The content (mime-type) is managed for you, but you can augment the mime-type table that is a part of the bean/plugin.
R1.2.16 of my software will be released on Monday 16th October 2006.
A notice will be posted to Beans and Plugins when the installation is available.
that feature request is on my list.
We will implement it this way (so that it also works in webclient) if you have: ‘my_image’ blob field where you build that media field on then you also specify ‘my_image_mimetype’ and ‘my_image_filename’ and we will also update those fields when the my_image field is filled.
These 2 fields don’t have to be db columns if you don’t want it it could also be virtual columns. So that you only read it once in (in the onchange of the blob field itself)
The mime type can currently also be get from the images plugin. That will work for most files.
I already use a similiar method, but it means drag and drop doesn’t work.
What would be great, is an event trigger on drag and drop onto media fields, with arguements such as filename, path, mime, etc., passed to the triggered method.