我遇到Dropbox PHP SDK的问题。几分钟后,我有异常:'操作太慢。小于1024字节/秒传输最后10秒'。我想它可以与PHP配置相关。我可以上传100MB文件没有问题,但我无法上传更大的文件。我正在使用chunkUploader(5MB块)和ng-file-upload
public function store(Request $request)
{
$chunk_number = (int)$request->input('_chunkNumber');
$chunk_size = (int)$request->input('_chunkSize');
$total_size = (int)$request->input('_totalSize');
$file = $request->file('file');
$file_content = file_get_contents($file->getRealPath());
$total_chunks = floor($total_size/$chunk_size);
//First chunk
if($chunk_number == 0){
$id = Dropbox::chunkedUploadStart($file_content);
$expires_at = Carbon::now()->addMinutes(60);
Cache::put('id', $id, $expires_at);
}
//Add new chunk
if($chunk_number > 0 && $chunk_number <= $total_chunks){
Dropbox::chunkedUploadContinue(Cache::get('id'), $chunk_number*$chunk_size, $file_content);
}
//Finish upload
if($chunk_number == $total_chunks){
Dropbox::chunkedUploadFinish(Cache::get('id'), '/file', Dropbox\WriteMode::add());
}
}
堆栈跟踪:
{}主要
[2016-03-25 10:37:27] local.ERROR:异常'Dropbox \ Exception_NetworkIO',带有消息'执行HTTP请求时出错:操作太慢。在/Users/x/Workspace/ez_api/vendor/dropbox/dropbox-sdk/lib/Dropbox/Curl.php:73中传输最后10秒的小于1024字节/秒
堆栈跟踪:
/Users/x/Workspace/ez_api/vendor/dropbox/dropbox-sdk/lib/Dropbox/Client.php(719):Dropbox \ Curl-&gt; exec()
/Users/x/Workspace/ez_api/vendor/dropbox/dropbox-sdk/lib/Dropbox/Client.php(548):Dropbox \ Client-&gt; _chunkedUpload(Array,'\ x00 \ x00 \ x00 \ x00 \ x00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 ...')
/Users/x/Workspace/ez_api/vendor/graham-campbell/manager/src/AbstractManager.php(234):call_user_func_array(Array,Array)
/Users/x/Workspace/ez_api/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(216):GrahamCampbell \ Manager \ AbstractManager-&gt; __ call('chunkedUploadSt ...',阵列)
/Users/x/Workspace/ez_api/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(216):GrahamCampbell \ Dropbox \ DropboxManager-&gt; chunkedUploadStart('\ x00 \ x00 \ x00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 ...')
/Users/x/Workspace/ez_api/app/Http/Controllers/AttachmentController.php(58):Illuminate \ Support \ Facades \ Facade :: __ callStatic('chunkedUploadSt ...',Array)
/Users/x/Workspace/ez_api/app/Http/Controllers/AttachmentController.php(58):GrahamCampbell \ Dropbox \ Facades \ Dropbox :: chunkedUploadStart('\ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 ...')
/Users/x/Workspace/ez_api/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(256):call_user_func_array(Array,Array)
/Users/x/Workspace/ez_api/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(164):Illuminate \ Routing \ Controller-&gt; callAction('store',Array)