b00*_*ter 4 safari upload file-upload form-data jquery-file-upload
我在 PHP 上有一个简单的页面站点,用户可以在其中上传文件(stl-model)。起初我是用来上传 JS 的FormData。它适用于 Chrome 和 Firefox,但 Safari iOS 有时会发送大小为 0 字节的文件。JS console.log 显示,发送前文件大小为 718120 字节。PHP 调试模式显示全局$ _FILE存在且文件名为真,但文件为空:
(
[name] => TRRSExtenderMount.stl
[type] => application / octet-stream
[tmp_name] => / tmp / phphDceFc
[error] => 0
[size] => 0
)
Run Code Online (Sandbox Code Playgroud)
大小为 0 的错误不时重复。
我试过的:
但错误再次重复。我究竟做错了什么?
所以,我解决了这个问题。也许我的经验可以帮助某人:
this.trueFile = new File([this.originalFile], 'file-name.stl', {lastModified: new Date()});
Run Code Online (Sandbox Code Playgroud)
TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode
Run Code Online (Sandbox Code Playgroud)
dataType: 'json'从我的代码中。它有帮助。| 归档时间: |
|
| 查看次数: |
1385 次 |
| 最近记录: |