Upload a file to a Dropbox account in C# - c#

Supposing I have a user's log in information for Dropbox (his e-mail and the password), how can I upload a file to his account from C#? Is there any way or should I try with another service like Skydrive or Google Drive?

If you want to use Google Drive, the documentation is at https://developers.google.com/drive/, however, you should never ask for other users' credentials and instead use OAuth 2.0.
The reference guide includes C# snippets and there's also a complete ASP.NET MVC tutorial that you can use to get started: https://developers.google.com/drive/examples/dotnet

Related

Is possible download file from drive.google without credentials

I searched this subject at many web pages and I tried; but every time web page verification window appears. Already I have ClientId and SecretKey. Is that not enough? I want to do this with c# but without credential.
The easiest way would be via the C# api. You can create an api key and use the library to download files by authenticating with that api key
Google Drive .NET api

upload file to google drive windows forms c#

Basically the idea of ​​the program is as follows: The user enters their email account and password google drive, then select the file and click upload button.
Can this be done?
Yes, but you have to have an embedded browser to handle the authentication using OAuth, as the client will need to enter their credentials into the Google login page. A previous answer here How to publish Google Docs in .NET? also indicates there is a .net library (which I havent tried) that might help.

Upload files on cloud using email address

So I am not sure if it is possible and if it is making sense at all. I am trying to learn and use cloud space in my application. So as a sample I was trying to create an application to upload files in Google Drive. I registered my application and used some references given by Google. And I am able to upload files now.
I registered my app using myname#gmail.com and used Client_Id and Client_Secret given in my account to create the app. When I upload the files, files get uploaded to my myname#gmail.com account. But what I want is, my app should give an option to user to login into there gmail accounts. Whoever logs in (say with email your#gmail.com), my app should be able to upload files to there account. I believe offline Google Drive app for desktop works the same way. Enter your username and password and files will sync to that account. Can anyone point me to a sample code please?
I want to upload files, read them, delete them, share them through my app. I am not giving any code sample, but if its needed let me know. Thanks.
You can do it. You will need to navigate user to a specific URL, where he will input his email and password. After that Google will give you authorization code and refresh token. Refresh token can be used to retrieve authorization code whenever it is expired.
This authorization code is used to work with user drive.
If your application is a web application you may navigate user to google and set callback to your custom URL.
If it is a windows forms application, then you have 2 options
Create custom browser window and parse DocumentTitle property
Navigate user's browser and ask him to copy-paste code from title (or do it automatically)
You may download an example from here
Just fill CLIENT_ID and CLIENT_SECRET constants.

Youtube: Upload video to multiple accounts

I am developing an c# application to upload videos to youtube from my local drive to different accounts. Currently I am not using youtube API to upload the videos and I use webclient class & a google developer key to do it. I am able to upload the videos successfully to the account which is associated with the developer key. However when I use the credentials of different youtube account it's not able to upload and I get the error
"Currently authenticated user does not have write access to username myusername"
I am not sure about the cause of this error. Or is it that do I need to change any settings in the youtube account to enable the access for the application to upload videos? I assume I need to use the youtube API to do it. Are there any other methods to upload a video to different youtube account by providing the username and password with my developer key?
The problem was wit the url to upload to a comment.
Thanks.
I have no idea what the "webclient class" you refer to means. You should be using the official YouTube API if you're programmatically interacting with YouTube.
The correct way to handle uploads is to use the username "default" when constructing your upload URL, as described at
https://developers.google.com/youtube/2.0/developers_guide_protocol_direct_uploading
This will ensure that the upload goes into the account associated with the current authorization token.
There's sample code to do this using the .NET client library available at
https://developers.google.com/youtube/2.0/developers_guide_dotnet#Direct_Upload

List Dropbox Files using REST API

I want to list all the files of a folder from my own Dropbox account on my website. I was going to use C# and the Dropbox Rest API but from reading the documentation it appears that I can't do that without first getting the user to go to dropbox to receive an authorisation token.
Is this correct? Is there anyway I can return the data in code without asking the user to log in?
Actually no.
You need to authenticate first using OAuth and than get list of files. Documentation is here
Also as tutorial here:
https://github.com/geersch/DropboxRESTApi

Categories

Resources