Use file in database

Hello everyone :sweat_smile:,
I am requesting your help. I am designing a mobile application for healthcare professionals. I have a list of links that allow downloading drug sheets in PDF format (example: https://app.fagg-afmps.be/pharma-status/api/files/62bc4a1c1e5c015ab3a7dbd2).
I have two requests regarding this matter.

  • Firstly, how can I download these files via these links directly into my database to be used directly in the application later on?

  • Secondly, if this is not possible, how can I enter the link into the database and ensure that the file is not downloaded firstly but opened within the application (view the PDF file directly in the application) and if possible, saved on the phone (saving the file avoids the need to redownload it later on).

Thank you in advance for your help :wave:

It’s much easier to use links.

This is not possible unless you have access to the HTML structure of where the files are hosted. Here’s why.

So what I suggest is:

  • Download the files and host them in Google Drive (or any cloud storage)
  • Set the sharing for those files allowing anyone with the links to view them
  • Use those links

That should do the trick.

thank you for your answer.
for my first question. when I upload link in the database (see screenshot), when the user click on the link (button on the app), they have a popup to download the file. while I want it view in the app.
But if i use your solution (google drive link), would not have the same problem ( file is propose to dowload and not watch on app).
more i think the link for my files, is links only for download file and not view its???

Google Drive files behave differently. Give it a try and you will see.

1 Like

weldone it’s work perfectly :upside_down_face: : https://drive.google.com/file/d/1giUcAwqqEpzXE3MvPr1RADnYUAfo99up/view?usp=share_link

but but but …
I have a database in my medecine dictionnary about 11500 entry ( a sample : Feuille de calcul sans titre - Google Drive)…
how can I do it, without have to do it one by one myself? help help
thanks you advence.
best regard

I did a simple Google search on how to download multiple files at once and found a few solutions.

Remember to ask Google when in doubt :wink:

hello weldone , thank you. what is the few solutions you found?

I did a simple Google search on how to download multiple files at once and found a few solutions.

I’m sure you can perform the same search on Google :wink:

hello, you right. I search few moment and I find a solution. I use freedownload manager, to download each file one by one in a same folder. it will download all file (wich have the same name) with a order number (ex: RCP1, RCP2 , etc). then I upload all file in google drive, and then I use a script ( thank chat gpt) to downlaod all the link in google drive and correspondant file name in a excel table.
A little hard by fonctionnal!!!
thank you for your help

1 Like