akpna.blogg.se

Google drive upload
Google drive upload










google drive upload

Step-3: In the third step& you have to click on the Save URL to Google Drive button in the new window to finish the task.

google drive upload

Step-2: Now paste the link and select the target folder that you want to save to and click on the Save& Copy to Google Drive button. MimeType = regKey.GetValue("Content Type"). Step-1: First go to the website of Copy URL to Google Drive. If (regKey != null & regKey.GetValue("Content Type") != null) String ext = System.IO.Path.GetExtension(fileName).ToLower() Here's the little function for determining a file's MIME Type: private static string GetMimeType(string fileName) MessageBox.Show("The file does not exist.","404") MessageBox.Show(e.Message,"Error Occured") System.IO.MemoryStream stream = new System.IO.MemoryStream(byteArray) įilesResource.InsertMediaUpload request = _(body, stream, GetMimeType(_uploadFile)) You can then use the following code for receiving user's consent and obtaining an authenticated Drive Service string scopes = new string īyte byteArray = System.IO.File.ReadAllBytes(_uploadFile) Learn more about Authorizationįor a start, you have to enable your Drive API, register your project and obtain credentials from the Developer Console This Access Token is used to send API requests. The Access Token will be returned, upon receiving user's consent. For accessing a user's Google Drive, you'll have to receive an Access Token from Google for that particular account. Not sure what you meant by "upload with mail ID".












Google drive upload