I have simple-page site on PHP, where users can upload file (stl-model).
At first I was use for upload JS FormData
. It's work in Chrome and Firefox, but Safari iOS sometimes send file with size = 0 bytes.
JS console.log show, that file size 718120 bytes before send. PHP debug mode show that global $ _FILE
exists and file name is true, but file is empty:
(
[name] => TRRSExtenderMount.stl
[type] => application / octet-stream
[tmp_name] => / tmp / phphDceFc
[error] => 0
[size] => 0
)
The error with size 0 repeats from time to time.
What I tried:
But the error was repeated again. What am I doing wrong?
So, I fixed this problem. May be my experience can help somebody:
this.trueFile = new File([this.originalFile], 'file-name.stl', {lastModified: new Date()});
TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode
dataType: 'json'
from my code. And it helped.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With