Drive api v3 Can't download file
See original GitHub issuepublic static void DLPC(IDownloadProgress downloadProgress)
{
Console.WriteLine("IDownloadProgress:" + downloadProgress.Status.ToString());
}
//---------
DriveService ds = await GetGoogleDriveService("user");
var filerequest = ds.Files.Get(fileid);
Stream stream_write = new FileStream("D:\\result.txt",FileMode.CreateNew, FileAccess.Write);
filerequest.MediaDownloader.ProgressChanged += DLPC;
filerequest.Download(stream_write);
Console write “IDownloadProgress:Completed” but file size still zero
Version: 1.44.1.1876 (Latest) Framework: C# .net F 4.5
Issue Analytics
- State:
- Created 4 years ago
- Comments:10
Top Results From Across the Web
Can not download files using Google Drive APIs V3
I'm trying to download files using Google Drive APIs V3 with alt=media option. But I can't start download in a web browser. My...
Read more >Download & export files | Google Drive
The Google Drive API supports several types of download and export actions, as listed in the following ... System.err.println("Unable to move file: "...
Read more >Cannot download a google drive file with the correct filename
My issue is that I cannot for the life of me figure out how to download files using the API with the correct...
Read more >Not able to Downloading Files using Google Drive API V3
Coding example for the question Not able to Downloading Files using Google Drive API V3.
Read more >Unable to download file via Google Drive API
In API v3 you get a promise from "drive.files.get" and on the promise resolve you have the "data" stream function downloadFile(drive, fileId, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For the “live” part, can’t you just use the stream that your code would write into as the stream that you pass into the
Download
method? If that doesn’t work for you for some reason, you could potentially create your own stream implementation, but fundamentally the client library doesn’t provide any way of getting a stream that you can read from. I don’t know about the WebContentLink aspect for private files - but that wouldn’t be specific to the .NET client library anyway. For support on the general API (including the WebContentLink) I would suggest using the options listed on the Drive API support page - I’m afraid the maintainers of this repository know about the API client libraries, but not the details of each specific API.I’ll close this issue now as I believe it’s been resolved as far as we’re able to help you, i.e. the client library aspect.
@mirror222