I have a project, deployed on the google App Engine.
I want to upload files to Google drive.
I am using a form with enctype=multipart/form-data
Where the user can select a file to upload with the input:
<input type='file' name='fileToUpload' >
after the submit - $_FILES
looks like this:
array(1) { ["fileToUpload"]=> array(5) { ["name"]=> string(44) "Noordzee zit weer vol vis - De Standaard.pdf" ["type"]=> string(15) "application/pdf" ["tmp_name"]=> string(20) "vfs://root/uploads/0" ["error"]=> int(0) ["size"]=> int(654999) } }
Especially ["tmp_name"]=> string(20) "vfs://root/uploads/0"
is a bit disappointing, it doesn’t look like a temp file on the server...
If I want to read the temp-file contents in php:
$data = file_get_contents( $_FILES['fileToUpload']['tmp_name'] );
this is the result:
Warning: file_get_contents(): Unable to find the wrapper "vfs" - did you forget to enable it when you configured PHP? in /base/data/home/apps/xxxxxx/UploadFile.php on line 38 Warning: file_get_contents(vfs://root/uploads/0): failed to open stream: No such file or directory in /base/data/home/apps/xxxxxxxx/
I use a php.ini and I think the problem has to do with the php configuaration on the server.
I want to read the 'fileToUpload' files data, insert a file in google drive and write the read content to the inserted file on drive.
This comes down to uploading a file to google drive.
Can someone please help me to resolve this problem?