-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drive.files.insert doesn't support parents #96
Comments
|
@rakyll I also tried that, as mentioned in my comment below the code. |
robbiet480 - Can you try the upload function in my app and see if it works for you ? |
The code above sets parents as a list of IDs: |
When I set the "convert" parameter to "true", "parents" is ignored. But if "convert" is "false" "parents" works fine. Here is my upload function: var upload = function(client, cb) { client.drive.files.insert({ title: 'My Document1', mimeType: 'text/csv', convert: true, parents: [ { 'id': '0B31SIwvSUVG2UFBRTXdGU0J1U2s' } ] }) .withMedia('text/csv', '1,2,3') .withAuthClient(auth).execute(cb); }; |
convert is a query parameter, does the behaviour change when it's set as a query param? It looks like there is an API bug when it's a part of the body -- it should have been ignored. var upload = function(client, cb) {
client.drive.files.insert({
convert: true
},
{
title: 'My Document1',
mimeType: 'text/csv',
parents: [
{
'id': '0B31SIwvSUVG2UFBRTXdGU0J1U2s'
}
]
})
.withMedia('text/csv', '1,2,3')
.withAuthClient(auth).execute(cb);
}; |
Yes, your code works fine for me. Thank you. |
The separation between query parameters and body is so fine that many people trip up on this idea. This needs to be better documented. Leave this issue open for tracking purposes. |
Seems like the library is changing pretty often recently. This works for me ("googleapis": "~1.0.3"):
|
@pawelrychlik Thank you! |
Which documents? Is there any way we can make them better? :) |
@ryanseys SDK shouldn't change main api buy not change major version number. And there is not any document tell developers about this. |
When we changed the main API, we changed from 0.8.x to 1.0.x. The documentation is lacking an update on developers.google.com but here the documentation in this README should be up to date. Thanks for your comments. |
Hope you can be serious about main api change. I'm sorry to said 'suck'. I was just crazy about the upgrade made my project couldn't work. |
@yangsibai Sorry to hear of your troubles. Check out the migration guide for everything you need to know about migrating your project from 0.x.x to 1.0.x |
It’s ok now, thank you for your work. I get this trouble in 0.x.x upgrade, I shouldn't complain about the beta version,I was too sensitive.
|
You're welcome! Thank you for your feedback. |
No matter what I do, I can't get parents to be set on a file. Here's my current code:
I can make the insert request find, and a list request. I've tried setting up the parents array with both raw elements and objects containing id and kind. Also, the
basePath
override is due to the fact that I keep getting errors stating that the URL needs to be/upload/drive/v2/files
, not/drive/v2/files
Thanks for the help
The text was updated successfully, but these errors were encountered: