(item)
| 483 | } |
| 484 | |
| 485 | async function uploadSingle(item) { |
| 486 | const formData = new FormData(); |
| 487 | appendCommonFormData(formData); |
| 488 | const rel = getRelativePathForItem(item.file); |
| 489 | if (rel !== item.file.name) { |
| 490 | formData.append('relativePath', rel); |
| 491 | } |
| 492 | formData.append('fileToUpload', item.file, item.file.name); |
| 493 | |
| 494 | await xhrJson(uploadUrl, formData, function (evt) { |
| 495 | if (!evt.lengthComputable) return; |
| 496 | const pct = Math.min(100, Math.max(0, Math.round((evt.loaded / evt.total) * 100))); |
| 497 | setItemStatus(item, 'uploading', pct); |
| 498 | }); |
| 499 | } |
| 500 | |
| 501 | async function uploadChunked(item) { |
| 502 | const rel = getRelativePathForItem(item.file); |
no test coverage detected