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













0















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"









share|improve this question






















  • 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















0















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"









share|improve this question






















  • 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













0












0








0








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"









share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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

















  • 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












1 Answer
1






active

oldest

votes


















2














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'
));





share|improve this answer























  • 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










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
);



);













draft saved

draft discarded


















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









2














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'
));





share|improve this answer























  • 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















2














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'
));





share|improve this answer























  • 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













2












2








2







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'
));





share|improve this answer













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'
));






share|improve this answer












share|improve this answer



share|improve this answer










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

















  • 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



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?