Solved Upload file on a server (1 Viewer)

freuzo

Member
Local time
Today, 15:48
Joined
Apr 14, 2020
Messages
39
Hello everyone. I'm trying to move my backend to MySql (I posted another thread for it) and the future users asked the possibility of attaching pdf files to the records on one of the tables. The files will be approximately 2 to 3 MB. I read that it should be loaded on a server and only display the link to the file.

How can I integrate it via VBA directly into one of my forms? So that at the click of a button, the user is led to select his file, then the file is loaded onto the server (with perhaps a progress bar) and the link kept in a field? I know that this is not a new problem, but I cannot find a specific thread. Those that I find are a little too complex compared to what I need.

Any advice or useful link would be appreciated.
Thanks.
 

freuzo

Member
Local time
Today, 15:48
Joined
Apr 14, 2020
Messages
39
Thank you for the link. I take a look at it.
 

Gasman

Enthusiastic Amateur
Local time
Today, 14:48
Joined
Sep 21, 2011
Messages
7,112
You could also allow the user to select a local file, copy it to the server and store that path automatically?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:48
Joined
Oct 29, 2018
Messages
13,100
Hi. The issue with storing files in a database is mostly for Access. If you're using MySQL, I am not sure you have to worry about the same issue. If the user has to view the file, your application might have to download it first from the server. Just a thought...
 

freuzo

Member
Local time
Today, 15:48
Joined
Apr 14, 2020
Messages
39
Hi. The issue with storing files in a database is mostly for Access. If you're using MySQL, I am not sure you have to worry about the same issue. If the user has to view the file, your application might have to download it first from the server. Just a thought...
Do this mean that, if my backend is on MySql I just need to create a common attachment field?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:48
Joined
Oct 29, 2018
Messages
13,100
Do this mean that, if my backend is on MySql I just need to create a common attachment field?
Hi. I could be wrong, but I am not sure MySQL has an "attachment" field. From reading your other thread, I got the impression you're migrating to MySQL Server because your users are not on the same location/network. If so, then how do you plan for your users to "share" their files? What good would one user storing a local path to a file in a record if another user don't have access to that path. If you plan on storing the file on the network, what would that file path look like, and would all users be able to use/access it? If MySQL is anything like SQL Server, it should have a Binary data type, which you can use to store the actual file in the database. If so, any user will have access to those files if they have access to the database.
 

freuzo

Member
Local time
Today, 15:48
Joined
Apr 14, 2020
Messages
39
Hi,
I did like you said theDBguy, a Binary data type. After some deep research on MySql as backend, I chose to create a blob field to save those pdf files into.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:48
Joined
Oct 29, 2018
Messages
13,100
Hi,
I did like you said theDBguy, a Binary data type. After some deep research on MySql as backend, I chose to create a blob field to save those pdf files into.
Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom