dongyao4419 2015-03-06 20:15
浏览 43
已采纳

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?

  • 写回答

1条回答 默认 最新

  • douci1615 2015-03-20 00:30
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何能达到用ping0.cc检测成这样?如图
  • ¥15 关于#DMA固件#的问题,请各位专家解答!
  • ¥15 matlab生成的x1图不趋于稳定,之后的图像是稳定的水平线
  • ¥15 请问华为OD岗位的内部职业发展通道都有哪些,以及各个级别晋升的要求
  • ¥20 微信小程序 canvas 问题
  • ¥15 系统 24h2 专业工作站版,浏览文件夹的图库,视频,图片之类的怎样删除?
  • ¥15 怎么把512还原为520格式
  • ¥15 MATLAB的动态模态分解出现错误,以CFX非定常模拟结果为快照
  • ¥15 求高通平台Softsim调试经验
  • ¥15 canal如何实现将mysql多张表(月表)采集入库到目标表中(一张表)?