dongmaomou4117 2017-07-19 18:10
浏览 60

谷歌应用引擎PHP文件上传“vfs:// root / uploads / 0”

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?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看