Placing a graphic into a Media field

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?

Try right-clicking on the field and you will get a contextual menu with a ‘load image’ command

Harry

or drag’n’drop that should also work.

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?

Thanks

that not possible currently, Servoy 2.5 will have drag and drop support on fields/elements

Ok. Thanks!

Hello everyboby,

Can someone confirm if it`s possible in Servoy 3.0 to retireve the filepaths when files are being dropped in Servoy?

Droping of files in a Media field is supportd in client. It returns a unique number eg: ‘[B@19097a5’.

How can I retrieve the Filepath from there?
Is the drop of multiple files also possible?

Kind regards Rene

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.

I will out a request in the support system.

Thanks Harjo,

I saw your request but I wasn’t sure if this feature was allready posssible without the triggers.

that not possible currently, Servoy 2.5 will have drag and drop support on fields/elements

Rene.

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:

  1. import data to database record
  2. 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.

Was this ever implemented?

I can’t find any documentation on how to have the filename or mimetype set when populating a media field via drag n drop or contect menu.

Is there a method trigger? or globals the data is put in?

Thanks!

NCM
FSCI

Rich Coulombre posted a nice method using showDirectorySelectDialog at:

http://forum.servoy.com/viewtopic.php?t … age+folder

Dean Westover
Choices Software, Inc.

Thanks.

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.

NCM
FSCI