首先,我使用
ng-flow(html5文件上传的extension.js框架)
我的文件已上传,我将该事件记录在控制台中.
但我不明白在哪里和如何拯救他们.
<div flow-init flow-files-submitted="$flow.upload()"> <div class="drop" flow-drop ng-class="dropClass"> <span class="btn btn-default" flow-btn>Upload File</span> <span class="btn btn-default" flow-btn flow-directory ng-show="$flow.supportDirectory">Upload Folder</span> <b>OR</b> Drag And Drop your file here </div>
这是我的配置
app.config(['flowFactoryProvider',function (flowFactoryProvider) { flowFactoryProvider.defaults = { target: 'upload.PHP',permanentErrors: [404,500,501],maxChunkRetries: 1,chunkRetryInterval: 5000,simultaneousUploads: 4,singleFile: true }; flowFactoryProvider.on('catchAll',function (event) { console.log('catchAll',arguments); }); // Can be used with different implementations of Flow.js // flowFactoryProvider.factory = fustyFlowFactory; }]);
<script>alert('alert' + array(8) { ["flowChunkNumber"]=> string(1) "1" ["flowChunkSize"]=> string(7) "1048576" ["flowCurrentChunkSize"]=> string(6) "807855" ["flowTotalSize"]=> string(6) "807855" ["flowIdentifier"]=> string(11) "807855-3png" ["flowFilename"]=> string(5) "3.png" ["flowRelativePath"]=> string(5) "3.png" ["flowTotalChunks"]=> string(1) "1" } )</script>
但是当我在这里我要做的是保存我的文件?
我试图在flowFilename和flowRelativePath上执行move_uploaded_file(),但没有附加.
我是新的在js.
谢谢.
解决方法
看看upload.PHP示例脚本:
https://github.com/flowjs/flow.js/blob/master/samples/Backend%20on%20PHP.md
// init the destination file (format <filename.ext>.part<#chunk> // the file is stored in a temporary directory $temp_dir = 'temp/'.$_POST['flowIdentifier']; $dest_file = $temp_dir.'/'.$_POST['flowFilename'].'.part'.$_POST['flowChunkNumber'];