I am trying to upload a local CSV file to Google Drive and display it as a Google spreadsheet. However, when I go to my Google Drive and click on the link to my file, I can download it, rather than view it as a spreadsheet. Have I tried to use? Convert = true, but the file is not converted. I also tried using application/vnd.google-apps.spreadsheetas a mime type, but noting the changes, or I get a 400 Bad request response.
Google_ServiceException with the error "POST call https://www.googleapis.com/upload/drive/v2/files?convert=true&uploadType=multipart: (400) Invalid mime type provided by 'in / var / www / html / twittery / lib / google -api-php-client / src / io / Google_REST.php: 66 Stack trace: # 0 / var / www / html / twittery / lib / google -api-php-client / src / io / Google_REST.php (36): Google_REST :: decodeHttpResponse (object (Google_HttpRequest)) # 1 / var / www / html / twittery / lib / google -api -php-client / src / service / Google_ServiceResource.php (186): Google_REST :: execute (object (Google_HttpRequest)) # 2 / var / www / html / twittery / lib / google -api-php-client / src / contrib /Google_DriveService.php(484): Google_ServiceResource β __ call ('insert', Array) # 3 / var / www / html / twittery / generate _tweets_GSpreadsheet.php (84): Google_FilesServiceResource-> insert (Object (Google_DriveFile), array) # 4 {main}
user4888557
source
share