![]() MimeType = regKey.GetValue("Content Type"). If (regKey != null & regKey.GetValue("Content Type") != null) String ext = System.IO.Path.GetExtension(fileName).ToLower() So, go ahead and disable it and try uploading the files over Mobile Data. 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") Set your manual upload preferences: Setting your manual upload preferences makes it easier for you to have consistency when youre uploading files or folders. 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 Long-press on the Google Drive icon and open the app info. This Access Token is used to send API requests. If your Google Drive upload process is stuck due to a slow or sketchy internet connection, you should force stop the process and try again. The Access Token will be returned, upon receiving user's consent. Click 'Upload' in the upper-righthand corner. ![]() ![]() If you're an iOS user, click 'Photos and Videos' after clicking 'Upload.' Choose the album with the photo you want to upload. For accessing a user's Google Drive, you'll have to receive an Access Token from Google for that particular account. Choose the photo you want to upload from the File Explorer app and tap on that photo to add it to Google Drive. ![]() Not sure what you meant by "upload with mail ID". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |