-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,在上传文件过程中出现 "写文件失败" 问题,是否需要某些配置支持? #94
Comments
之前没人报过这个错误,linux测试是没问题的,我上传过4g的文件。 |
windows环境测试正常,其实已经可以证明代码没问题了,我估计还是你哪里修改了配置的原因。 |
有一种可能是你是在本地上传,上传速度非常快,但服务器的内存又比较小,而linux的机制会在频繁读写磁盘的时候自动在内存中替你缓存文件,导致你最后内存被完全占满,所以写入失败,这个是我的猜测。 |
根据上面的猜测,可以尝试把上传的分块大小加大,以此来减少文件读写频率,如果用的是nignx的话,具体是将nginx.conf中的 |
我也遇到上传失败的问题了, |
@phpervip |
@peinhu 感谢回复,确实不是程序的问题,是我们自己机器上有另外的进程影响了上传。 |
在上传上百兆文件时,windows 环境测试没有问题,但在 linux 上,上传中途会出现 “写文件失败”,记录到的异常如下:
[2020-05-26 19:54:28] local.INFO: params: {"resource_ext":"wav","chunk_total":"643","chunk_index":"81","resource_temp_basename":"1590494060728318","group":"file","group_subdir":"202005","locale":"zh","resource_hash":"c714edb26be58b2cee794528d66ddf51","expires":"1584516038","signature":"34597f8bd5e8d632628a443d4b27f53ab8c872a4c4a6afe150d2603fa1eedeaf","resource_chunk":"[object] (Illuminate\\Http\\UploadedFile: /tmp/php5upMt8)"} [2020-05-26 19:54:28] local.INFO: fileSize:1000000 [2020-05-26 19:54:28] local.INFO: Exception:错误:写文件失败 path:aetherupload/file/202005/1590494060728318.wav.part [2020-05-26 19:54:29] local.ERROR: 错误:删除文件失败 {"exception":"[object] (Exception(code: 0): 错误:删除文件失败 at /data/www/v8_file/vendor/peinhu/aetherupload-laravel/src/PartialResource.php:59)
文件夹权限是正常的,小一点文件也可以正常上传,请问是服务器需要调整某些配置嘛?
The text was updated successfully, but these errors were encountered: