Welcome! Log In Create A New Profile


Best way to save files to server?

Posted by YogiYang 
Best way to save files to server?
January 06, 2022 12:30PM

I am developing a client server based multi user software. Here HFSQL server will run on Win 2016 Server and clients will run on PCs with Windows 7 or Windows 10.

In this I have to allow a user to browse and select a file to attach when making an Entry. This file should be available to any user who access that Entry.

Can we achieve something like this?

If yes then: What is the best way to achieve this?


Yogi Yang

Yogi Yang
Re: Best way to save files to server?
January 06, 2022 02:23PM
I do that by adding a F_Files file in my DB... each record has an ID, the ID of the main record it is linked to, in some case a description/title of the file, and a binary memo field to store the file chosen by the user.

So it's just an hadd to store the file, and it is saved with the DB (or replicated with it, as I'm using Fabrice's wxreplication extensively)
Re: Best way to save files to server?
January 07, 2022 06:42AM

Thank you for your tip. I am already saving the file to DB in a Binary Memo field but this is making the database very bulky.

Instead I am looking for a way to upload the file to server and store is in a folder and save the name of the file in DB. This way the DB size becomes quite small.

The files involved are generally images, CAD drawings, PDF and office documents.

And CAD and image files are sometimes very bulky.

Yogi Yang
Re: Best way to save files to server?
January 08, 2022 01:58AM
Hello Yogi,

I send the document to the server via the database like you are doing. Then I pull it out of the database and store on the server in a local drive. When I want to view it I use a stored procedure to load it in the database then I save it on the local machine in a temp file and open it with Shellexecute. There is a lot more to it but that is the short version.

I use 3 tables 1 for session to Identify the user pulling and sending the files and a Transport for the binary that holds and then deletes it when done also one to store the document name size and file location on the server. 4 or 5 stored procedures for add , read , delete and rename. I also track the file when the user opens it to save any changes back to the server.

One of my customers has over 250,000 pdfs stored about 100 gigs


Your Email:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.