Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
For issues with the Google Photos app, please see:
-----------------------
Before filing an issue, please read and follow these instructions carefully.
First, please search through existing issues to ensure that the bug has not already been reported. You can start the search here:
If the issue has already been reported, you can click the star next to the issue number to subscribe and receive updates. We prioritize responding to the issues with the most stars. You can also comment on the issue to provide any details of your experience with it.
If your issue has not been reported, please delete this introduction and provide all of the following:
(Please enable *Markdown* for improved formatting of your report.)
---------------------------------------------------------------------------
# Description
A short description of the issue.
I'm working with Photos API with C#. The MediaDownloader class provide a method to download stream in range but if the range is totally out of the media item, the download result is always the whole media content.
# Detailed description
Describe the issue in further detail using the following sections.
## API calls
The calls to the API that lead to the error. Include the sequence of calls, including request headers and body.
Do not include any personal information, authentication secrets, media item or album IDs.
```
Please use markdown syntax to format your code.
```
Range Header does not work well for media items
## Steps to reproduce the problem
What steps will reproduce the problem?
Take a 27KB file as example.
If I download from 0KB to 10 KB or 10KB to 20KB of the file, the Range header works well and I'm able to get the correct bytes. while If I try to download range totally out of the item itself, e.g., from 28KB to 30KB, even with the range header, the full content (27KB) is returned. And there is no size in photo property, so that It's hard for us to know whether the media item is read to end.
Besides, I test the similar issue with Google Drive API, if the range is out of the file, the download request will return nothing, so that I could make sure that the download is finished.
## What is the expected output?
Please describe what you expected the API to return.
if the range is out of the file, the download request will return nothing, so that I could make sure that the download is finished.
## What do you see instead?
If you see error messages, please provide them.
if the range is out of the file, the download request will return whole file content.
## Code sample
A small code sample that reliably reproduces the issue. The sample should run as-is or with minimal setup.
```
MediaDownloader = new Google.Apis.Download.MediaDownloader(service);
if(MediaDownloader is MediaDownloader downloader)
downloader.Range = new System.Net.Http.Headers.RangeHeaderValue(from, to);
return MediaDownloader.Download(baseUrl, stream);
// the baseUrl is the url for media item
```
# Additional information
Please provide any additional information here.