Fixed
Status Update
Comments
jf...@google.com <jf...@google.com> #2
Thank you very much for the detailed report!
This does appear to be an issue - I have forwarded it to the engineering team and will let you know as soon as we have an update.
This does appear to be an issue - I have forwarded it to the engineering team and will let you know as soon as we have an update.
co...@gmail.com <co...@gmail.com> #3
I also confirm this problem. Looking forward for the resolution.
ru...@gmail.com <ru...@gmail.com> #4
Same here, I'm stuck because of this, the header doesn't seem to be working, the filename always sets to the upload date.
ny...@gmail.com <ny...@gmail.com> #5
Same problem here, having to use file description to track filenames. Would like to have the ability to change existing file name to something new to close this issue.
jf...@google.com <jf...@google.com> #6
We have just released a new version of the Google Photos Library API that fixes this issue.
Thanks for your patience!
Note that you now have to set the 'X-Goog-Upload-Protocol' header to 'raw' as well. The upload media guide has the updated details:https://developers.google.com/photos/library/guides/upload-media
Also see our release notes for further details:https://developers.google.com/photos/library/support/release-notes#2018-07-31
Thanks for your patience!
Note that you now have to set the 'X-Goog-Upload-Protocol' header to 'raw' as well. The upload media guide has the updated details:
Also see our release notes for further details:
ru...@gmail.com <ru...@gmail.com> #7
Thank you, I just made a quick test and seems to be working fine here!
ch...@gmail.com <ch...@gmail.com> #8
still not working now.... (2018-11-26)
Description
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 provide all of the following:
-----------------------------------------------------------------------------------------------------------------------------
A short description of the issue:
X-Goog-Upload-File-Name header field in not populating the filename shown to the user in Google photos. If the header is not set, the end result is the same: Date of the upload is shown in the "Info" from the photo
Your project number from the Google Developers Console:
297439611009
A small code sample that reliably reproduces the issue. The sample should run as-is or with minimal setup.
var accessToken = "";
var filename = "testfilename.jpg";
var albumID = "";
var fileURL = "";
var description = "Desc: " + filename;
var response = UrlFetchApp.fetch(fileURL, {muteHttpExceptions: true});
var binaryBlob = response.getBlob();
var api = "
var headers = {
"Authorization": "Bearer " + accessToken,
"Content-type": "application/octet-stream",
"X-Goog-Upload-File-Name": filename
};
var options = {
"headers": headers,
"method" : "post",
"payload" : binaryBlob.getBytes()
};
var uploadToken = UrlFetchApp.fetch(api, options);
var token = uploadToken.getContentText();
var api2 = "
headers = {
"Authorization": "Bearer " + getService().getAccessToken(),
};
var JSONObject = {
"albumId": albumID,
"newMediaItems":
{
"description": description,
"simpleMediaItem": {
"uploadToken" : token
}
}
};
options = {
"headers": headers,
"contentType" : "application/json",
"method" : "POST",
"muteHttpExceptions": true,
"payload" : JSON.stringify(JSONObject)
};
var response = UrlFetchApp.fetch(api2, options);
var json = JSON.parse(response.getContentText());
Logger.log(json);
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.
What steps will reproduce the problem?
1. Upload the file with "X-Goog-Upload-File-Name" header set
2. Call "mediaItems:batchCreate" on the token generated with upload
3. Open the picture in Photos
4. Open info blade
5. File name is set to the upload date instead of the file name provided in the "X-Goog-Upload-File-Name" header
What is the expected output? What do you see instead? If you see error messages, please provide them.
Expected:
File name in Photos is set to the "X-Goog-Upload-File-Name" header
Actual:
File name in Photos is set to the upload date
Please provide any additional information below.