Error 'Google_Service_Drive_ChildReference' not foundHow do I get PHP errors to display?How to fix “Headers already sent” error in PHPReference - What does this error mean in PHP?Can't Upload File to Google Cloud Storage with PHP Client Libraryupload image file to google cloud storageTrying to migrate SQL commands from plain PHP using Yii2Google cloud storage: How can I reset edge cache?Googledrive API Upload file via PHP return Erroryii2 Webhook post emptyGoogle Cloud Platform: Unable to upload a new file version in Storage via API
Is a stroke of luck acceptable after a series of unfavorable events?
Pole-zeros of a real-valued causal FIR system
Term for the "extreme-extension" version of a straw man fallacy?
How do I rename a Linux host without needing to reboot for the rename to take effect?
How can I quit an app using Terminal?
What happens if you roll doubles 3 times then land on "Go to jail?"
Why does indent disappear in lists?
Did Dumbledore lie to Harry about how long he had James Potter's invisibility cloak when he was examining it? If so, why?
How to Reset Passwords on Multiple Websites Easily?
Arithmetic mean geometric mean inequality unclear
Is exact Kanji stroke length important?
How does buying out courses with grant money work?
Would a high gravity rocky planet be guaranteed to have an atmosphere?
Why are there no referendums in the US?
Large drywall patch supports
Sequence of Tenses: Translating the subjunctive
Why escape if the_content isnt?
How to be diplomatic in refusing to write code that breaches the privacy of our users
What can we do to stop prior company from asking us questions?
Energy of the particles in the particle accelerator
How do I extract a value from a time formatted value in excel?
Can the discrete variable be a negative number?
What is the opposite of 'gravitas'?
Increase performance creating Mandelbrot set in python
Error 'Google_Service_Drive_ChildReference' not found
How do I get PHP errors to display?How to fix “Headers already sent” error in PHPReference - What does this error mean in PHP?Can't Upload File to Google Cloud Storage with PHP Client Libraryupload image file to google cloud storageTrying to migrate SQL commands from plain PHP using Yii2Google cloud storage: How can I reset edge cache?Googledrive API Upload file via PHP return Erroryii2 Webhook post emptyGoogle Cloud Platform: Unable to upload a new file version in Storage via API
I am trying to use Google Drive and Google Cloud Storage, but I got the error:
Class 'Google_Service_Drive_ChildReference' not found'
Here's my code
$ref = new Google_Service_Drive_ChildReference();
$ref->setId($createdFile->getId());
$drive->children->insert($view->drive_folder, $ref);
Anyone have any idea of how to fix this problem? I tried all i could but doesn't work. Also note i am using Yii2 Framework with PHP 7.3.0
This is what i have in my composer.json
"google/apiclient": "^2.2"
php google-api yii2 google-drive-sdk google-cloud-storage
add a comment |
I am trying to use Google Drive and Google Cloud Storage, but I got the error:
Class 'Google_Service_Drive_ChildReference' not found'
Here's my code
$ref = new Google_Service_Drive_ChildReference();
$ref->setId($createdFile->getId());
$drive->children->insert($view->drive_folder, $ref);
Anyone have any idea of how to fix this problem? I tried all i could but doesn't work. Also note i am using Yii2 Framework with PHP 7.3.0
This is what i have in my composer.json
"google/apiclient": "^2.2"
php google-api yii2 google-drive-sdk google-cloud-storage
which service APi are you referencing to? google drive does not have any namespace with that name that is why you are getting that error where did you get that code from?
– Muhammad Omer Aslam
Mar 22 at 0:41
@MuhammadOmerAslam developers.google.com/drive/api/v2/reference/files/insert
– Gabriel
Mar 22 at 4:37
add a comment |
I am trying to use Google Drive and Google Cloud Storage, but I got the error:
Class 'Google_Service_Drive_ChildReference' not found'
Here's my code
$ref = new Google_Service_Drive_ChildReference();
$ref->setId($createdFile->getId());
$drive->children->insert($view->drive_folder, $ref);
Anyone have any idea of how to fix this problem? I tried all i could but doesn't work. Also note i am using Yii2 Framework with PHP 7.3.0
This is what i have in my composer.json
"google/apiclient": "^2.2"
php google-api yii2 google-drive-sdk google-cloud-storage
I am trying to use Google Drive and Google Cloud Storage, but I got the error:
Class 'Google_Service_Drive_ChildReference' not found'
Here's my code
$ref = new Google_Service_Drive_ChildReference();
$ref->setId($createdFile->getId());
$drive->children->insert($view->drive_folder, $ref);
Anyone have any idea of how to fix this problem? I tried all i could but doesn't work. Also note i am using Yii2 Framework with PHP 7.3.0
This is what i have in my composer.json
"google/apiclient": "^2.2"
php google-api yii2 google-drive-sdk google-cloud-storage
php google-api yii2 google-drive-sdk google-cloud-storage
asked Mar 21 at 15:55
GabrielGabriel
552215
552215
which service APi are you referencing to? google drive does not have any namespace with that name that is why you are getting that error where did you get that code from?
– Muhammad Omer Aslam
Mar 22 at 0:41
@MuhammadOmerAslam developers.google.com/drive/api/v2/reference/files/insert
– Gabriel
Mar 22 at 4:37
add a comment |
which service APi are you referencing to? google drive does not have any namespace with that name that is why you are getting that error where did you get that code from?
– Muhammad Omer Aslam
Mar 22 at 0:41
@MuhammadOmerAslam developers.google.com/drive/api/v2/reference/files/insert
– Gabriel
Mar 22 at 4:37
which service APi are you referencing to? google drive does not have any namespace with that name that is why you are getting that error where did you get that code from?
– Muhammad Omer Aslam
Mar 22 at 0:41
which service APi are you referencing to? google drive does not have any namespace with that name that is why you are getting that error where did you get that code from?
– Muhammad Omer Aslam
Mar 22 at 0:41
@MuhammadOmerAslam developers.google.com/drive/api/v2/reference/files/insert
– Gabriel
Mar 22 at 4:37
@MuhammadOmerAslam developers.google.com/drive/api/v2/reference/files/insert
– Gabriel
Mar 22 at 4:37
add a comment |
1 Answer
1
active
oldest
votes
You need to look here which tells you that this class was changed to Google_Service_Drive_DriveFile
since 1.0.0
version so you can change the above code to
$file = new Google_Service_Drive_DriveFile();
$result = $service->files->insert($file, array(
'data' => file_get_contents(TESTFILE),
'mimeType' => 'application/octet-stream',
'uploadType' => 'media'
));
Unfortunately, it is not work, I have already tried, this is for v2, v3 has different flow :(
– Gabriel
Mar 25 at 5:30
@Gabriel , well that's odd how have you modified the code, can you share in the question by editing and what error are you getting, you need to init the$service
in the above code before you use it
– Muhammad Omer Aslam
2 days ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55284450%2ferror-google-service-drive-childreference-not-found%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to look here which tells you that this class was changed to Google_Service_Drive_DriveFile
since 1.0.0
version so you can change the above code to
$file = new Google_Service_Drive_DriveFile();
$result = $service->files->insert($file, array(
'data' => file_get_contents(TESTFILE),
'mimeType' => 'application/octet-stream',
'uploadType' => 'media'
));
Unfortunately, it is not work, I have already tried, this is for v2, v3 has different flow :(
– Gabriel
Mar 25 at 5:30
@Gabriel , well that's odd how have you modified the code, can you share in the question by editing and what error are you getting, you need to init the$service
in the above code before you use it
– Muhammad Omer Aslam
2 days ago
add a comment |
You need to look here which tells you that this class was changed to Google_Service_Drive_DriveFile
since 1.0.0
version so you can change the above code to
$file = new Google_Service_Drive_DriveFile();
$result = $service->files->insert($file, array(
'data' => file_get_contents(TESTFILE),
'mimeType' => 'application/octet-stream',
'uploadType' => 'media'
));
Unfortunately, it is not work, I have already tried, this is for v2, v3 has different flow :(
– Gabriel
Mar 25 at 5:30
@Gabriel , well that's odd how have you modified the code, can you share in the question by editing and what error are you getting, you need to init the$service
in the above code before you use it
– Muhammad Omer Aslam
2 days ago
add a comment |
You need to look here which tells you that this class was changed to Google_Service_Drive_DriveFile
since 1.0.0
version so you can change the above code to
$file = new Google_Service_Drive_DriveFile();
$result = $service->files->insert($file, array(
'data' => file_get_contents(TESTFILE),
'mimeType' => 'application/octet-stream',
'uploadType' => 'media'
));
You need to look here which tells you that this class was changed to Google_Service_Drive_DriveFile
since 1.0.0
version so you can change the above code to
$file = new Google_Service_Drive_DriveFile();
$result = $service->files->insert($file, array(
'data' => file_get_contents(TESTFILE),
'mimeType' => 'application/octet-stream',
'uploadType' => 'media'
));
answered Mar 22 at 19:52
Muhammad Omer AslamMuhammad Omer Aslam
13.5k72548
13.5k72548
Unfortunately, it is not work, I have already tried, this is for v2, v3 has different flow :(
– Gabriel
Mar 25 at 5:30
@Gabriel , well that's odd how have you modified the code, can you share in the question by editing and what error are you getting, you need to init the$service
in the above code before you use it
– Muhammad Omer Aslam
2 days ago
add a comment |
Unfortunately, it is not work, I have already tried, this is for v2, v3 has different flow :(
– Gabriel
Mar 25 at 5:30
@Gabriel , well that's odd how have you modified the code, can you share in the question by editing and what error are you getting, you need to init the$service
in the above code before you use it
– Muhammad Omer Aslam
2 days ago
Unfortunately, it is not work, I have already tried, this is for v2, v3 has different flow :(
– Gabriel
Mar 25 at 5:30
Unfortunately, it is not work, I have already tried, this is for v2, v3 has different flow :(
– Gabriel
Mar 25 at 5:30
@Gabriel , well that's odd how have you modified the code, can you share in the question by editing and what error are you getting, you need to init the
$service
in the above code before you use it– Muhammad Omer Aslam
2 days ago
@Gabriel , well that's odd how have you modified the code, can you share in the question by editing and what error are you getting, you need to init the
$service
in the above code before you use it– Muhammad Omer Aslam
2 days ago
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55284450%2ferror-google-service-drive-childreference-not-found%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
which service APi are you referencing to? google drive does not have any namespace with that name that is why you are getting that error where did you get that code from?
– Muhammad Omer Aslam
Mar 22 at 0:41
@MuhammadOmerAslam developers.google.com/drive/api/v2/reference/files/insert
– Gabriel
Mar 22 at 4:37