I'm trying to upload a local CSV-file to Google Drive and display it like a Google Spreadsheet there. However, when I go to my Google Drive and click the link to my file, I can only download it, not view it as a spreadsheet. I've tried using the ?convert=true but the file doesn't get converted. I've also tried using application/vnd.google-apps.spreadsheet
as the mime type but noting changes or I get a 400 Bad request response.
exception 'Google_ServiceException' with message 'Error calling POST https://www.googleapis.com/upload/drive/v2/files?convert=true&uploadType=multipart: (400) Invalid mime type provided' 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}