Launching a media file in a network

Is it possible to launch a media file without sharing the volume that contains the actual file?

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

jcompagner:
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?

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?

Riccardino:
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:

Riccardino:
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.:slight_smile:
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…

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.

jaleman:
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?

Riccardino:

jaleman:
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?

jaleman:

Riccardino:

jaleman:
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). :slight_smile:

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)

jcompagner:
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

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

jcompagner:
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: