fix: Correctly define array - not multidimensional array #136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was going crazy today trying to figure out why I was getting 0 sized files on upload. Finally I noticed that I had based my work on this sample code I found on this page: https://developers.google.com/drive/api/guides/manage-uploads and the array of parameters was being doubly defined creating a multidimensional array instead of just passing parameters.
Removing either the array() or the [] around the array elements solves the problem. I'm not sure which is the preferred coding style for this project as I see several other sample files that are also using both methods of defining an array.
I also see that the 'fields' parameter is being passed - but the API docs don't show that as a paramter for the create endpoint. https://developers.google.com/drive/api/v3/reference/files/create so it appears that isn't needed either unless the api reference is out of date.