GAE上PHP 5.5中的直接文件上传功能是什么?
I gotten an mail from Google about PHP 5.5 runtime and list of new features in it. One of them is listed as support for direct file upload. Can any one explain what does that mean.
Does this mean that I can upload files to the temp directory, extract the data and then destroy the file?
我收到了一封来自Google的关于PHP 5.5运行时的邮件以及其中的新功能列表。 其中一个被列为对直接文件上传的支持。 任何人都可以解释这是什么意思。 p>
这是否意味着我可以将文件上传到临时目录,提取数据然后销毁文件? p> div>
This link has the instructions how to do direct file upload.
https://gae-php-tips.appspot.com/2015/03/09/direct-file-uploads-for-php-5-5/
Thanks @StuartLangley
What I found is that old apps have to enable a settings called cloud integration.
https://cloud.google.com/appengine/docs/java/googlecloudstorageclient/activate
That explains it. Please go to App Engine admin console (https://appengine.google.com), choose "Application Settings" on the left, click on "Create" button under "Cloud Integration" section, and you should have a default gcs bucket created.
Thx @mars..@google.com
Also this part of the code
// Direct uploads requires PHP 5.5 on App Engine.
if (strncmp("5.5", phpversion(), strlen("5.5")) < 0) {
die("Direct uploads require the PHP 5.5 runtime.");
}
Does not actually tell you if your version is 5.5. I have been running 5.4 for days and it didn't dawn on me as I thought this would work blindly.
A more working model is this one
// Direct uploads requires PHP 5.5 on App Engine.
if (strncmp("5.5", phpversion(), strlen("5.5")) != 0) {
die("Direct uploads require the PHP 5.5 runtime.");
}
Hope this helps any one who is working on direct file uploads for PHP in GAE. Now I can start working on my csv files yay.