Link to home
Start Free TrialLog in
Avatar of fmichail
fmichailFlag for Canada

asked on

How to have a drive stream for free

My windows rich client application (in VB.NET) accesses images using a path that the user provides in the setup... It is supposed to be a shared location on the server. Now, I want to allow saving these files in Google Drive, however, my application needs a windows file path to deal with the files (Not a URL). Is there a free way to create a virtual drive Say G: so that I can access these files through the application as if they are in the LAN.... something like Google drive stream but FREE. OR is there a way to handle this "Cloud" storage as a drive in my application in VB.NET. Your help is appreciated. Thanks
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Hi fmichail,

As you have already suggested your concern can be solved by two different methods
1. By changing your app to consume Google Drive APIs https://developers.google.com/drive/api/v3/about-sdk. Good news, if you ask me, is that the library is already available, along with a sample quick-start project. You can get started by installing the official Nuget package
Install-Package Google.Apis.Drive.v3

Open in new window

and follow instructions from this page https://developers.google.com/drive/api/v3/quickstart/dotnet.

2. You can use Google's Backup and Sync https://support.google.com/drive/answer/2374987 - which might not be a good idea in case you want to share your app with others.

Regards,
Chinmay.
Avatar of fmichail

ASKER

Hi Chinmay,
Thanks for replying. So what is my client supposed to do, should they just create a Google drive common to all the users?. I believe that the amount of application changes required will be big , since linking the passengers in the system to their passport photo, and personal photo, and others will be hard to handle. The best option is If there is a utility which marks the specific location in the cloud as Drive (E.g. G:) drive, so all the client needs is to define the files path only once as G: and the application will follow that up.

And if I use the SDK, how about the distribution of the application, I suppose a runtime version of it should be available.

I will visit the links you provided and assess the amount of required work to use it, So please allow me couple of days for some investigations, and I will let you know. Thanks so much Chinmay
Not at all. A Google drive common to all the users is a disaster. my Back up and Sync suggestion was on that line only. Your end users can defined a folder which will be then synced to their individual Google Drive.

And yes SDK just installs certain assemblies nothing more. However, I was digging more to understand how they are licensed and their support and it seems they are in maintenance mode: https://github.com/googleapis/google-api-dotnet-client.
Hi Chinmay,
I gave the SDK some considerations, but actually, It is a lot of changes in my application already used by clients in some companies. The best solution to me is using an additional layer to map a cloud location to a Drive character (E.g. G:). I will handle it as follows:
1. The application currently allows the admin to define a preset location on a publicly accessible location in the LAN to save documents and photos...etc. This could be in our example G:\the_documents
2. admin grant the users no access to this location (This is what the application does now)
3. The application manages this location through impersonation of an account (set by the admin) which have read/write permissions on it (This is what the application does now).

In other words, the users do not manage the files directly, only through the application because the files are renamed to fit the coding, so the application can link the files to the entities they belong to.

If I have this extra layer to have a drive named (G: for example), There will be minimal if any changes in the code. Any input?
Thanks Chinmay
Got it. In that case, why not set up Backup and Sync on those locations (of course this will be done by admin so end users would never know what we are doing). That way the files will still sync to Google Drive but end users would never come to know.
It is not about sync it is about having a drive letter assigned to this location like G: The files will be copied there after changing names. Here is an example:

1. The passport scanner saves the photo (among others) in File Named <First Name> <space> <Last Name>.jpg in location <A>
2. With import functionality in the application, the file is obtained from location <A> and saved as <Passenger ID>_photo.jpg in location <G> where the system deals with it (Display/print/view/print cards....etc).
3. Both the path of <A> and <G> are defined in the system admin console setting as local File path (Share) (Not URL)
4. What I want in this example is to have a LAN path to replace <G>, and keep the functionality done without any code change.

Of course this is simplified example, and Google has drive Stream File which creates <G> and point to a URL (without indicating it is URL), the problem is that Google requires what they call G suite account to do that, and that will impose additional cost to my clients that I want to avoid specially if the cost is by user. Any thoughts, Chinmay?
Thanks
Just to be clear, your end goal is to have these files be stored in G Drive right? and your app should be able to access those files as and when needed right?
Exactly, Chinmay. However this G: drive is in the web not in the client Office LAN. I seek your ideas regarding this, Thanks Chinmay
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dear Chinmay,
I can see your approach, it makes sense... few more points to manage:

1. When the user displays a passenger info, a part of the information is the passport picture, and the photo. Currently, I am displaying them in picture box from the Server path that the application knows In this case //fileserver/folder/<Passenger ID>_photo.jpg, and //fileserver/folder/<Passenger ID>_passport.jpg (Or actually we create a drive mapping for //fileserver/folder and name it G:. How to replace the code to populate the picturebox by a URL path (which is wherever the Google drive is?
2. Same argument is used when trying other functions like printing the tracel cards, or Hotel voucher, or labels...etc

What do you think?
Dear Chinmay,

I uploaded (synced) group of pictures to a url, and used the picturebox to load one of them from the URL using the picturebox.load method, and it worked, so your idea of syncing the pictures is very good, and you gave me the solution.... If you are always that persistent in helping people, you are an amazing person... thank you very much for your great help
Thank you again Chinmay, your help is greatly appreciated
Hi fmichail,

Sorry I was traveling last couple of days and was not very active on EE. I am not always this persistent :P but I do try ALWAYS :).

I think in your case, you didn't lose your cool, did not excuse me of just asking useless questions and THE MOST IMPORTANT factor for me, are you willing to put in equal(or more efforts than me or not) - which you did. Even after I could not respond to your question about using the Picturebox you went ahead, gave it a try - that's very important in my books. While I do love it when I get points 'cause someone is being lazy, the question like this is where I EARN what I YEARN the most - an intellectual conversation/brainstorming.

Looking forward to have many more such conversations in future. All the very best.

Regards,
Chinmay.