Launching a media file in a network

Questions, tips and tricks and techniques for scripting in Servoy

Launching a media file in a network

Postby Riccardino » Sat Feb 14, 2004 5:56 pm

Is it possible to launch a media file without sharing the volume that contains the actual file?
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby jcompagner » Wed Feb 18, 2004 1:17 pm

What do you mean by launching a media file?
What are you trying to do
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Riccardino » Wed Feb 18, 2004 3:43 pm

jcompagner wrote:What do you mean by launching a media file?
What are you trying to do


Let's say I put a picture file in a blob field, but I don't want to save the original file (it could be very big). So I park the path to the file in a field and I store a thumbnail in the database.
I wrote a method that allows me to open the original file with its default application (Preview, Photoshop...), but it only works if I'm on the same machine where the picture resides or if the picture files are in a shared folder mounted on the my desktop.

My question is: is there a way to launch the file even if the shared folder is not mounted on the desktop?
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby jcompagner » Wed Feb 18, 2004 7:03 pm

And where must the file then come from?

if you store the path. And the path isn't there anymore what would you like use to do?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby ahmad » Thu Feb 19, 2004 7:46 am

Riccardino wrote: So I park the path to the file in a field and I store a thumbnail in the database.

My question is: is there a way to launch the file even if the shared folder is not mounted on the desktop?


Why cannot you use "http:// " instead of storing the local path.

If you use the local path it will work only on the local machine it's running. If you deploy solution on the network you can access the file using the URL like (http://serverip:8080/yoursolutionfolder/filename.jpg")

In your solution you create a global field called
g_Url = http://serverip:8080/yoursolutionfolder/

and you just store the Image_Filename in a field and open the image by concatenating g_Url & Image_Filename

This should work.

Pls note that servoy is shipped with the built in web server. You can either use that or use any other web server if you installed on your Server machine

If this is not clear.. some other experts may help you

Thanks
Ahmad
ahmad
 
Posts: 139
Joined: Wed Dec 24, 2003 12:01 pm
Location: Hong Kong

Postby Riccardino » Thu Feb 19, 2004 4:18 pm

ahmad wrote:
Riccardino wrote: So I park the path to the file in a field and I store a thumbnail in the database.

My question is: is there a way to launch the file even if the shared folder is not mounted on the desktop?


Why cannot you use "http:// " instead of storing the local path.

If you use the local path it will work only on the local machine it's running. If you deploy solution on the network you can access the file using the URL like (http://serverip:8080/yoursolutionfolder/filename.jpg")

In your solution you create a global field called
g_Url = http://serverip:8080/yoursolutionfolder/

and you just store the Image_Filename in a field and open the image by concatenating g_Url & Image_Filename

This should work.

Pls note that servoy is shipped with the built in web server. You can either use that or use any other web server if you installed on your Server machine

If this is not clear.. some other experts may help you

Thanks
Ahmad


It's clear and it works.:)
But "http" like paths are opened from the default web browser, instead of image's default application. Maybe I could try to pass this kind of path to a specific application and see if it works...
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby Jan Aleman » Thu Feb 19, 2004 5:17 pm

Just store the file in the database. A SQL database is as efficient as a file system to store files in. The next version of windows will in fact use SQL Server as it's file system.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby Riccardino » Thu Feb 19, 2004 8:40 pm

jaleman wrote:Just store the file in the database. A SQL database is as efficient as a file system to store files in. The next version of windows will in fact use SQL Server as it's file system.


Mmmm: it would be a great solution, but won't it slow down the database?
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby Jan Aleman » Thu Feb 19, 2004 9:52 pm

Riccardino wrote:
jaleman wrote:Just store the file in the database. A SQL database is as efficient as a file system to store files in. The next version of windows will in fact use SQL Server as it's file system.


Mmmm: it would be a great solution, but won't it slow down the database?


Not more than a filesystem would. Why do you think it would be slow?
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby Riccardino » Thu Feb 19, 2004 11:48 pm

jaleman wrote:
Riccardino wrote:
jaleman wrote:Just store the file in the database. A SQL database is as efficient as a file system to store files in. The next version of windows will in fact use SQL Server as it's file system.


Mmmm: it would be a great solution, but won't it slow down the database?


Not more than a filesystem would. Why do you think it would be slow?


I don't know the way SQL databases store data in blob fields, and I was planning to put 40/50.000 record, with size from 500 KB to 20 MB.

I tried to load only a dozen of picture files of 1 MB each on a MySQL table and I'm having problems in saving data (I get a message with
CANNOT SAVE FORM DATA java.sql.SQLException: must rollback must rollback). :)
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby jcompagner » Sat Feb 21, 2004 11:39 am

can you show me the log file contents when that happends (.log.txt)

The problem is that some drivers do some very strange things with blob loading. For example in firebird you have to store the blobs in a different table and then point to them with a relation. So that only when the blob is needed you get the relation. (firebird driver doesn't do lazy loading, what we are trying to do. Maybe mysql driver has the same problem)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Riccardino » Sun Feb 22, 2004 11:31 am

jcompagner wrote:can you show me the log file contents when that happends (.log.txt)


Sure: I'll send you all three of them . Btw the "must rollback" message appeared when I tried with firebird. With MySQL I get this message:
java.lang.IllegalArgumentException: Packet is larger than max_allowed_packet from server configuration of 1048576 bytes Packet is larger than max_allowed_packet from server configuration of 1048576 bytes
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby jcompagner » Sun Feb 22, 2004 12:30 pm

but that error that mysql gave you seems a configuration error of mysql itself!
You have to increase the package size as far as i can see you can't send blobs bigger 1M to mysql in that configuration
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Riccardino » Sun Feb 22, 2004 2:46 pm

jcompagner wrote:but that error that mysql gave you seems a configuration error of mysql itself!
You have to increase the package size as far as i can see you can't send blobs bigger 1M to mysql in that configuration


You'right, sorry... :oops:
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy


Return to Methods

Who is online

Users browsing this forum: No registered users and 30 guests