Skip to content

Commit

Permalink
Add uploadType when uploading a file
Browse files Browse the repository at this point in the history
  • Loading branch information
craig-mcmahon committed Feb 26, 2015
1 parent 8052071 commit e5084f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/GoogleHelper/Drive/FilesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ public function createFolder($str_folder_name, \Google_Service_Drive_DriveFile $
* @param string $str_file_name
* @param string $str_file_location
* @param \Google_Service_Drive_DriveFile $obj_folder
* @param string $str_upload_type
* @return \Google_Service_Drive_DriveFile
*/
public function uploadFile($str_file_name, $str_file_location, \Google_Service_Drive_DriveFile $obj_folder = null)
public function uploadFile($str_file_name, $str_file_location, \Google_Service_Drive_DriveFile $obj_folder = null, $str_upload_type = 'media')
{
//Insert a file
$obj_file = new \Google_Service_Drive_DriveFile();
Expand All @@ -118,7 +119,8 @@ public function uploadFile($str_file_name, $str_file_location, \Google_Service_D

return $this->service->files->insert($obj_file, array(
'data' => $str_data,
'mimeType' => $obj_file->getMimeType()
'mimeType' => $obj_file->getMimeType(),
'uploadType' => $str_upload_type,
));
}

Expand Down

0 comments on commit e5084f4

Please sign in to comment.