# Image Media stuffs

**URL:** <https://forum.servoy.com/t/image-media-stuffs/3034>\
**Category:** Classic Servoy\
**Created:** [November 9, 2004, 6:44am UTC](https://forum.servoy.com/t/image-media-stuffs/3034 "2004-11-09T06:44:45Z")\
**Posts on this page:** 9\
**Page:** 1

<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:44am UTC](https://forum.servoy.com/t/image-media-stuffs/3034/1 "2004-11-09T06:44:45Z")

</div>

Hi there,

I want to know how to get the file type (jpg, gif, doc, pdf, xls and others) of a file i am going to insert into a media field. To insert I use the following method.  
media\_content = application.readFile(media\_file\_path)

Also when I try to show an image in a media field where the file size is around 1.5mb then the system is crashed. Is it not recommended to show the file of that size or bigger?

Thanks

---

<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 10, 2004, 8:32am UTC](https://forum.servoy.com/t/image-media-stuffs/3034/2 "2004-11-10T08:32:08Z")

</div>

Anyone can give me some idea about this please…

Thanks a lot.  
Hameed

---

<div class="post-metadata">

**Author:** ![grahamg](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@grahamg](https://forum.servoy.com/u/grahamg)\
**Post date:** [November 10, 2004, 12:04pm UTC](https://forum.servoy.com/t/image-media-stuffs/3034/3 "2004-11-10T12:04:16Z")

</div>

Hi Hameed

Can’t respond re 1.5mb images crashing file - but have you seen tips from Harjo Kompagnie in Servoy Magazine. May be useful.

[http://www.servoymagazine.com/home/2004 … _put_.html](http://www.servoymagazine.com/home/2004/11/tip_how_to_put_.html)

Regards

Graham Greensall

---

<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:** [November 10, 2004, 10:43pm UTC](https://forum.servoy.com/t/image-media-stuffs/3034/4 "2004-11-10T22:43:42Z")

</div>

1.5MB file shouldn’t be a problem  
The only thing that really matters is the resolution. And how you display it.  
Did you display it full size?

if you want to know the type then you have to store the type besides the media field.

---

<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, 6:45am UTC](https://forum.servoy.com/t/image-media-stuffs/3034/5 "2004-11-11T06:45:28Z")

</div>

I display it using the dimension 200x200. I am sure that I have crashed the client by adding a 2mb jpeg file.

Do we have a function to get the type of the file that I can store in a field for later use?

Thanks

---

<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:** [November 11, 2004, 9:20am UTC](https://forum.servoy.com/t/image-media-stuffs/3034/6 "2004-11-11T09:20:06Z")

</div>

can you send me an 2MB jpg file and a small solution that does crash at youre place?

currently you have to do it youreself if you want the type (with a file open dialog ect)

---

<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 23, 2004, 1:03pm UTC](https://forum.servoy.com/t/image-media-stuffs/3034/7 "2004-11-23T13:03:57Z")

</div>

I could not reproduce this problem with a 2MB file. I will send you a sample solution when I get the problem again. But I would like know how to get the type of the file. Could you please show how to do it?

---

<div class="post-metadata">

**Author:** ![bcusick](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bcusick](https://forum.servoy.com/u/bcusick)\
**Post date:** [November 23, 2004, 6:34pm UTC](https://forum.servoy.com/t/image-media-stuffs/3034/8 "2004-11-23T18:34:59Z")

</div>

You have to store the type of file (read it from the path) and store it yourself in the database. Here’s currently no way to automatically “tell” what kind of binary is stored in a media column. This is because you can store ANY binary data in a media field (Word documents, spreadsheets, databases, whatever).

Hope this helps,

Bob Cusick

---

<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 24, 2004, 3:00am UTC](https://forum.servoy.com/t/image-media-stuffs/3034/9 "2004-11-24T03:00:52Z")

</div>

Ok. Thanks! I am using the file\_extension to handle this now.
