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.
Related
So I am making a program to upload YouTube videos to my clan channel so that I can distribute it to the other clan members and everything is all set...
They open the program, they browse the file, set the title, the privacy and press Upload. DONE
If they want they open the thumbnail changer, browse for the thumbnail press Upload. DONE
It works great!... In my computer, how can I make it that it works for everyone? because everytime I share it with one of the members... it doesn't work because they need to login using OAUTH (to one of their accounts).
Thanks for helping!
I'm coding in C# but that is not relevant at all.. by the way I've already tried older methods present in the API but it returns invalid request.
There is no way to use the YouTube API without Oauth. If you want to access private user data you need to have the permission of the user who owns the data.
Your only option would be to authenticate your code once and store the refresh token and use it when the others want to access your data. If you are using Google .net Client library check filedatastore its storing your refresh token.
Here is the code for uploading videos to youtube without OAuth, You only need API key, Username, Password.
https://developers.google.com/youtube/2.0/developers_guide_dotnet?csw=1#Direct_Upload
I have a problem. I use C# .Net 2013 Windows Form Application. I want to upload to Google Drive the file of the user selected.(The user cannot have a gmail account.) The project can work in any copmuter as .exe. However, the project wants to login in each case when I try. When I logged in, the project wants to allow from me. I don't want to this. Users will select the files they want to send and after that they will click on the send button. Users should not see any question. The selected file should be sent automatically. How can I do this?
Thanks for your help. Emrah.
It sounds like you want end users to upload files to a single Google Drive account. In that case you should probably look into using a Service Account, which allows the application to have it's own account without prompting the user for authorization.
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.
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
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