Я получил ответную мелкую загрузку, загружающую большой файл частями с помощью .NET Core REST API. Куски правильно записывают в файловую систему, и я отправляю ответ {"success": true}
200, который, похоже, нравится JavaScript Fine Uploader. Но теперь, с каждым ответом OK, браузер предлагает мне подтвердить, хочу ли я перезагрузить окно или отменить. Я понятия не имею, почему это происходит. Если я нажму «Отмена», следующий чанк будет успешно загружен, и я отправлю следующий ответ «ОК», и снова получу ту же подсказку браузера. Что может быть причиной этого?
Если я продолжу нажимать Отмена для каждого чанка до конца, он завершит всю загрузку и вызовет вызов конечной точки успеха чанка. Я полностью чешу голову. Я пытался отключить каждый вариант интерфейса по одному, но это не помогает. Любые идеи с благодарностью.
upload.js:
import React, { Component } from 'react'
import FineUploaderTraditional from 'fine-uploader-wrappers'
import Gallery from 'react-fine-uploader'
import 'react-fine-uploader/gallery/gallery.css'
const uploader = new FineUploaderTraditional({
options: {
debug: true,
chunking: {
enabled: true,
concurrent: {
enabled: false
},
success: {
endpoint: '/api/File/LargeUploadComplete'
}
},
deleteFile: {
enabled: false
},
request: {
endpoint: '/api/File/LargeUpload'
},
resume: {
//enabled: true
},
retry: {
showButton: true
//, enableAuto: true
}
}
})
class Upload extends Component {
render() {
return (
<Gallery uploader={uploader} />
)
}
}
export default Upload
Вот вывод отладчика тонкой загрузки. Вы можете увидеть 200 ответов:
1011 *
dnd.js:162 Grabbed 1 dropped files.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Received 1 files.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] onValidateBatch - waiting for onValidateBatch promise to be fulfilled for batch validation
fine-uploader.core.js:162 [Fine Uploader 5.16.2] onValidateBatch promise success for batch validation
fine-uploader.core.js:162 [Fine Uploader 5.16.2] onValidate - waiting for onValidate promise to be fulfilled for Item 'q4.csv', size: 59894927
fine-uploader.core.js:162 [Fine Uploader 5.16.2] onValidate promise success for Item 'q4.csv', size: 59894927
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Attempting to validate image.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] onSubmit - waiting for onSubmit promise to be fulfilled for 0
fine-uploader.core.js:162 [Fine Uploader 5.16.2] onSubmit promise success for 0
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Attempting to draw client-side image preview.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Attempting to determine if q4.csv can be rendered in this browser
fine-uploader.core.js:162 [Fine Uploader 5.16.2] First pass: check type attribute of blob object.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] q4.csv is not previewable in this browser per the blob's type attr
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Not previewable
fine-uploader.core.js:162 [Fine Uploader 5.16.2] onUpload for 0 returned a Promise - waiting for resolution.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] onUploadChunk for 0.0 returned a Promise - waiting for resolution.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Sending chunked upload request for item 0.0, bytes 1-2000000 of 59894927.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] xhr - server response received for 0
fine-uploader.core.js:162 [Fine Uploader 5.16.2] responseText = {"success":true}
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Received response status 200 with body: {"success":true}
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Chunked upload request succeeded for 0, chunk 0
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Chunk 0 for file 0 uploaded successfully.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] onUploadChunk for 0.1 returned a Promise - waiting for resolution.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Sending chunked upload request for item 0.1, bytes 2000001-4000000 of 59894927.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] xhr - server response received for 0
fine-uploader.core.js:162 [Fine Uploader 5.16.2] responseText = {"success":true}
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Received response status 200 with body: {"success":true}
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Chunked upload request succeeded for 0, chunk 1
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Chunk 1 for file 0 uploaded successfully.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] onUploadChunk for 0.2 returned a Promise - waiting for resolution.
fine-uploader.core.js:162 [Fine Uploader 5.16.2] Sending chunked upload request for item 0.2, bytes 4000001-6000000 of 59894927.