# Placing a graphic into a Media field

**URL:** <https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228>\
**Category:** Classic Servoy\
**Created:** [July 12, 2004, 9:36pm UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228 "2004-07-12T21:36:47Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morley](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@Morley](https://forum.servoy.com/u/Morley)\
**Post date:** [July 12, 2004, 9:36pm UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/1 "2004-07-12T21:36:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)\
**Post date:** [July 13, 2004, 2:41pm UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/2 "2004-07-13T14:41:33Z")

</div>

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

Harry

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [July 23, 2004, 8:41am UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/3 "2004-07-23T08:41:29Z")

</div>

or drag’n’drop that should also work.

---

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [November 9, 2004, 6:56am UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/4 "2004-11-09T06:56:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [November 10, 2004, 9:09pm UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/5 "2004-11-10T21:09:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [November 11, 2004, 5:12am UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/6 "2004-11-11T05:12:08Z")

</div>

Ok. Thanks!

---

<div class="post-metadata">

**Author:** ![Rene](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@Rene](https://forum.servoy.com/u/Rene)\
**Post date:** [October 14, 2006, 1:32pm UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/7 "2006-10-14T13:32:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [October 14, 2006, 2:27pm UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/8 "2006-10-14T14:27:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rene](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@Rene](https://forum.servoy.com/u/Rene)\
**Post date:** [October 14, 2006, 4:18pm UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/9 "2006-10-14T16:18:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cybersack](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@cybersack](https://forum.servoy.com/u/cybersack)\
**Post date:** [October 14, 2006, 11:31pm UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/10 "2006-10-14T23:31:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [October 16, 2006, 9:22am UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/11 "2006-10-16T09:22:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![fsciweb](https://avatars.discourse-cdn.com/v4/letter/f/46a35a/32.png) [@fsciweb](https://forum.servoy.com/u/fsciweb)\
**Post date:** [April 24, 2008, 12:24am UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/12 "2008-04-24T00:24:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Westy](https://avatars.discourse-cdn.com/v4/letter/w/9de053/32.png) [@Westy](https://forum.servoy.com/u/Westy)\
**Post date:** [April 24, 2008, 2:57am UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/13 "2008-04-24T02:57:29Z")

</div>

Rich Coulombre posted a nice method using showDirectorySelectDialog at:

[http://forum.servoy.com/viewtopic.php?t … age+folder](http://forum.servoy.com/viewtopic.php?t=6577&highlight=import+image+folder)

Dean Westover  
Choices Software, Inc.

---

<div class="post-metadata">

**Author:** ![fsciweb](https://avatars.discourse-cdn.com/v4/letter/f/46a35a/32.png) [@fsciweb](https://forum.servoy.com/u/fsciweb)\
**Post date:** [April 24, 2008, 3:37pm UTC](https://forum.servoy.com/t/placing-a-graphic-into-a-media-field/2228/14 "2008-04-24T15:37:48Z")

</div>

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
