Saving/loading files from the cloud?
Saving/loading files from the cloud?
One of my users has asked if my app's data files can be saved to the cloud, so they can be accessed from any PC that my app is run from, without him having to copy the data files to each PC manually. How would I do this? Say for Google Drive or DropBox?
Last edited by BarryG on Sat Aug 10, 2024 3:17 am, edited 2 times in total.
Re: Saving/loading files from the cloud?
BarryG,
For Dropbox, or google drive it is just a folder on your PC, PCloud is an actual drive p: onedrive/skydrive is also a folder in documents. When the user runs the program you have to make sure the datafile is not open by another user (or same user in a different pc) so you'll have to create some kind of file lock, I just use a text file with the computer name that has open the data files and once the data file closes you delete that text file. I use the computer name so that users know who to call and ask to get off the computer. If you dont manage file locking you'll endup with mutiple versions of your datafiles.
Norm.
For Dropbox, or google drive it is just a folder on your PC, PCloud is an actual drive p: onedrive/skydrive is also a folder in documents. When the user runs the program you have to make sure the datafile is not open by another user (or same user in a different pc) so you'll have to create some kind of file lock, I just use a text file with the computer name that has open the data files and once the data file closes you delete that text file. I use the computer name so that users know who to call and ask to get off the computer. If you dont manage file locking you'll endup with mutiple versions of your datafiles.
Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
Re: Saving/loading files from the cloud?
Okay, I'll download Google Drive on my PC (the app) and give it a try. Thanks!
I just thought there was a non-app way, kind of like FTP or something.
I just thought there was a non-app way, kind of like FTP or something.
Re: Saving/loading files from the cloud?
I don't remember it being so simple.
Authentication and error checking is critical.
Search for libcurl or chilkat.
Authentication and error checking is critical.
Search for libcurl or chilkat.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Saving/loading files from the cloud?
I installed the Google Drive app and now I have a G: drive for it in Explorer:

So I tried it, and it works!
Can't believe it was this simple:


So I tried it, and it works!


Re: [Solved] Saving/loading files from the cloud?
I'm doing this since years, with pcloud to synchronize files accross different PCs (and even Smartphones)
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{History Viewer Online}.:|:.{Send a Beer}
Re: [Solved] Saving/loading files from the cloud?
One issue: how can my app tell if it's using Google Drive (or any other cloud provider)? FileSize() still correctly returns -2 for any online folder, and GetDriveType_() returns #DRIVE_FIXED instead of #DRIVE_REMOTE for it. I need my app to behave a bit differently if an online folder is being used, but from my testing it seems I can't differentiate between a real local folder and a remote one.
Re: [Solved] Saving/loading files from the cloud?
Ah, so you are relying on an existing network drive?
Authentication is handled by the user.
I thought your app was supposed to connect to the cloud drive.
Authentication is handled by the user.
I thought your app was supposed to connect to the cloud drive.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Saving/loading files from the cloud?
Yes, as shown in the screenshots above. I haven't coded anything myself as I have zero network knowledge and skills.
Anyone know how to tell if my app is using a network drive as opposed to a local fixed one? See my post a bit further up.
Re: Saving/loading files from the cloud?
While conventional wisdom would recommend some form of cloud app hosting, you could also simply set up a local NAS. This would be the easiest solution if all the PCs are on the same LAN. However, even if the NAS requires online access, it wouldn't be too difficult to set up a local server on the premises with some port forwarding. The NAS would then be accessed through the server through some script. Granted, connectivity wouldn't be lightning fast, but for such requirements, it shouldn't pose much of an issue.BarryG wrote: Fri Aug 09, 2024 12:59 am...app's data files can be saved to the cloud, so they can be accessed from any PC that my app is run from...
Another option would be to go old-school and utilise Windows network sharing. With some port forwarding, it too could be accessed online.
App hosting starts cheap, but could scale very fast depending on usage.

Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: Saving/loading files from the cloud?
I just assume it is a cloud drive and handle the data accordingly ( locking files while the program is running, etc..)
maybe this could help for google drive:
https://www.purebasic.fr/english/viewto ... 42#p487042
pcloud is p: drive with a "pCloud Drive" label
dropbox is a folder , same with OneDrive. (c:\user\Normeus\Dropbox and c:\user\Normeus\OneDrive)
I do not have google drive but it might be as simple as the others.
Norm.
maybe this could help for google drive:
https://www.purebasic.fr/english/viewto ... 42#p487042
pcloud is p: drive with a "pCloud Drive" label
dropbox is a folder , same with OneDrive. (c:\user\Normeus\Dropbox and c:\user\Normeus\OneDrive)
I do not have google drive but it might be as simple as the others.
Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari