bitcoinnsa.blogg.se

Google drive api upload to shared drive
Google drive api upload to shared drive






Hope it helps.Īs per this documentation, the supportsAllDrives=true parameter informs Google Drive that your application is designed to handle files on shared drives. Works like a charm.I found the solution with the help of fellow commenter Hence posting the answer. I would like to take the time to thank user Richard on stack overflow for asking this question How to save a file to Google Drive from Flutter web without a local file on disk? The question was related to Flutter but I was intrigued as it was not something I tried before. However if is possible that the data may already reside within your application in memory in which case you can just upload the data as a memory stream. Normally we think of uploading Files so we would use a file stream reading all the file data into the stream and then uploading it.

google drive api upload to shared drive google drive api upload to shared drive

You can use any type of stream to upload the file to Google drive api. Normally we would create a File Steam if we are reading the file from disk. The key part of this code is where I concert the uploadString to a memory stream. In the above code I have a string variable called uploadString this variable is storing some text that I wish to upload to google drive to a text file called fileName. UploadedFileId = request.ResponseBody?.Id the file id of the new file we created The fact of the matter is you dont have to. Now if we look at all the upload samples for the Google drive api they are going to make you think that you will first need to save the file to disk before creating a file stream to upload it to Google drive. Now you want to upload the invoice to Google drive for storage, this is probably a bad example as you would probably want to store them in the database. You build up the invoice and its all stored within a variable within your application. What if its in memory? What if the data isn’t in a file?

google drive api upload to shared drive

This then leads you to wonder what would happen if the data you wish to upload isn’t actually on your disk. Even all of my own How to upload a file to Google Drive with C#. This implies that you have a file on your disk that you wish to upload. Most of if not all of the upload samples and examples for the Google drive api refer to it as file upload data. Google drive api Google drive API standard examples.








Google drive api upload to shared drive