dragon321723 2018-12-18 21:59
浏览 184

通过$ _FILES ['file'] ['tmp_name']上传后立即引用文件

I have a method that successfully uploads local files to an S3 bucket using the amazon SDK, all I need is a valid local path/to/file, which is the second param below:

$this->saveToAmazon($pathOnS3,$filename);

These local files are uploaded by the user and handled using the $_FILES global. Once the user uploads, we are copying to a local uploads folder via move_uploaded_file(). From there, we are calling the above function. This works fine, although this got me thinking.

Since for the life of the request, the file can be accessed temporarily via $_FILES['file']['tmp_name'], is it possible to 'hack' together a temporary valid file path to provide the saveToAmazon() function without having to call move_uploaded_file() and using the local uploads folder? essentially tapping in to the local php/tmp directly?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测