Software Media Database Storage

How to store media content like images/video files then later retrieve them and display them in any software/application? Like for example Cloud base data Storage. What if I want to display server content in my app.

There are many ways to achieve this. You can for instance use use CURL or SFTP etc. for retrieving data from a cloud storage, you can embed these files with your application, you can use an installation program to install the media files in separate folder, etc. But usually you need a reference to these files, if you don’t want to “hardcode” everything, that’s when a database comes into the game.

You can store “media” (binary) files in databases in “special” fields called BLOBs for most database brands. But there are many caveats with that approach. Generally speaking it is known as a (very) bad way to deal with binary data by storing them into a database, as it will blow up your database a lot!

A better ways is to give your filename a random filename and storing the file physically in own folders in a local or cloud path. In your database you will then store only the link (the path + filename) and the metadata etc. to reference to your physical file. For a “random” name you can for instance use the random function in Xojo and combine it with the current timestamp ( total seconds ), that should be most likely unique, even if you have many users using your app.

This is a very generic question, and there are many ways to solve it: using for instance a cloud storage with an API to retrieve your data, or writing your own API … but I hope I was able to give you some ideas for your research and more specific questions.

1 Like

Using the database for file names, paths and metadata, a good additional idea is store in the DB a small thumbnail of the image file.

This way you can have an almost immediate picture to display while the real one is retrieved and downloaded on a separate thread.

1 Like

I’m Talking about storing files on an internet server then later display them withing any app whether windows Mac or android apps? For Example, Having a List of Music Files on the web then load them in any kind of app weather windows or android.

why not use some ready made app like plex or kodi for that purpose ?

1 Like

I’m trying to come up with my own app.

1 Like

That’s a challenging project but excellent to learn all features of Xojo and it is definitely feasible (well for Android you have to wait or make a web app), but it will be very hard to compete with the alternatives @Jean-Yves_Pochez mentioned ;-).