google-api-php-client icon indicating copy to clipboard operation
google-api-php-client copied to clipboard

Undefined index: type in ..\vendor\google\apiclient\src\Service\Resource.php:281

Open arlequin99 opened this issue 3 years ago • 2 comments

Hi I'm getting undefined index 'type' and 'location' when trying to upload a 2MB csv file to Google Drive but I can't find any docs about 'type' and 'location' parameters.

$driveService = $this->getDriveInstance();

  $fileMetadata = new \Google\Service\Drive\DriveFile(array(
      'parents' => array('xxxxxxxxx')
  ));
  
  $file = $driveService->files->create($fileMetadata, array(
      [
          'data' => $stringContent,
          'mimeType' => 'text/csv',
          'uploadType' => 'media',
      ]
  ));

Thanks!

arlequin99 avatar Aug 02 '22 18:08 arlequin99

@arlequin99 could you please pass the error log and the stack trace?

vishwarajanand avatar Aug 04 '22 11:08 vishwarajanand

i have the same error, How can I be sure that the connection was successful?

engalirock avatar Sep 18 '22 23:09 engalirock