How can I upload files to GoogleDrive in “multipart” type by using Guzzle?
问题 With the help of @Tanaike(see here), I can successfully upload files to GoogleDrive by using php-curl, here is my code by using php-curl: function uploadByCurl($uploadFilePath, $accessToken){ $ch = curl_init(); $boundary = md5(mt_rand() . microtime()); //MetaData $params = json_encode([ 'name' => basename($uploadFilePath), 'description' => 'This is a test', ]); $fileContent = file_get_contents($uploadFilePath); $dataToUpload = "--{$boundary}\r\n"; $dataToUpload .= "Content-Type: application