How do I upload file to google drive? - c#

I have checked out tons of links for upload file directly in Google Drive.
I have created a sample application and it's working as expected, but the problem is it's requires the user to login with Google account.
I want to make an web application, where the user who's selecting file can directly upload it to example#gmail.com Google drive. So user don't have to signing with own google account.
How can I achieve a goal?
It's a great help if you have a sample code for this.
Thanks in Advance

As you said, Google Drive needs an account to authenticate and know where to upload the file.
If you want to upload it to a shared place, then create an account for that purpose and use those credentials to log in.
But for your case, if it's not a requirement to use google drive but just a cloud file storage, SmartFile is a lot better for that kind of programs, I'm using it in my own projects and works like a charm, check the Developer account, it gives you 100Gb of space and 200Gb of monthly traffic, and uses a very clean REST api (I have no relatinoship with them, just a happy user).
https://www.smartfile.com/

Related

Which cloud storage (dropbox, googledrive, ?) able to be accessed by multi user without Oauth authentication

I want to create a mobile app (xamarin form, c#) that access a cloud storage to store my files like .csv and images which are read only by users.
I could then update the data/files in the storage, and make it available to all users.
I don't want my users to authenticate by using their account.
I expect that the app know how to connect and access to my account (i.e. my dropbox account or gdrive account) in background. It will be seamless to the user.
In short, I would like make my dropbox or gdrive or other clouds files, able to be seen by all users via my app
I tried dropbox and gdrive, but it seems like they use Oauth which require users to login to their account, I don't want that.
Any recommendation or some insight for me?
Thanks a lot stackoverflow
If you want to store user information in the cloud service in any way, Google Drive may be the best choice.
The following address describes all the requirements for integrating the application with Google Drive
https://developers.google.com/drive/api
In Google Drive, you will receive an API key through which your application will upload and download files, and you do not need to create an account for the application's uses or personally authentication.
To use, it is enough to be able to call a rest API
and here it is the API reference:
https://developers.google.com/drive/api/v3/reference

How to upload file in Google drive through download link with Google drive Api

I am using Google drive API in my Asp.net MVC project and I want to get an idea about making a copy of file or Upload a file with Shared Link. So first understand the scenario.
A User generates a public download link of any file and provide it to my website. Any other user should be able to click on the download button. the specific shared file should be add into the user's drive. Not in (Share With Me) but in User's own Drive Storage.
If anyone have a idea to this so please let me know.
There are many ways you could do this but the best way would depend on what access you would have, as in I am assuming the application would be authenticated to upload the user's google drive. One way could be that using the google drive api you could download the file to a directory then perform an upload to the destination then delete the downloaded file. You can check out the documentation developers.google.com/drive/api/v3/manage-uploads

Google Drive C# login withou UI

I have a google account thehumpt#gmail.com.
I need to develop a Windows desktop software which automatically saves files to google drive.
I've checked some internet links and didn't found any way how to automatically login to my google account without UI login interaction.
Can you tell me possible ways how can my program login to google drive account without UI communication (interaction)? Is it possible?
Regards.
I can login to google drive with service account but this is not my case.
I've tried access token but this token will expire in one hour and my program cannot access Google Drive after that.
I expect to run my program on regular basis it will save files to my Google Drive.

File Drag&Drop from Browser to Browser

My asp.net web application is some kind of "document managment system" saving files in the file system of the server.
The stored files are shown in an asp:ListView control and are downloadable as HTTP- Download. But I also want to drag&drop them into another browser window to upload the draged file to an cloud storeage like dropbox or google drive oslt.
I did some research and I didn't find any solution for this problem. I don't know if this is even possible. Maybe someone has an idea how this could be done?
I am pretty sure you can't have a web application doing that for you because it involves having your web language interacting with your computer, to move a local file to another window or tab in the browser.
It would be similar to have Javascript accessing your local files without the user "help". That is not allowed.
Rather than doing that, why not connect to Google Drive or Dropbox API and make the upload yourself?
In the piece of code where you trigger the download, you could also trigger an upload to the desired service.
Here are the API Documentation for the mentioned services:
https://www.dropbox.com/developers/documentation/http/documentation#file_requests-create
https://developers.google.com/drive/api/v3/manage-uploads

How to embed google drive video only on my website

i want to ask about the idea of embedding google drive video to my website.
To give more details, i have videos on my google drive account, i want to share these videos to my website, so my website users can see them after login to my website.
i tried "any one with the link" but actually if anyone get the link then they can view the video which is not my goal, im also avoiding using the option of specific people as i want my website users to view it only.
is this applicable ? maybe using APIs ?
my project is asp.net
Perhaps using something such as Google Sign-In and storing the video on something such as Google Cloud Storage may work better for your needs.
https://developers.google.com/identity/sign-in/web/
https://cloud.google.com/storage/docs/?hl=en_US&_ga=2.45789092.-1485116680.1546457475
There is documentation available for .net on the google cloud.
https://cloud.google.com/dotnet/

Categories