-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
Last part of chunk not merged with laravel 8 #120
Comments
You are free to debug it and fix it? My tests were working. Maybe there will be a bug in special environment while sorting the chunks. |
Did you find the solution? I have the same problem. |
I think the problem may be when the request is with loadbalancer, the files generated in the chunk folder are different, the solution was to disable in the config the value of name->use all to false |
If the session changes then it is definitelly a problem :) Good find. Maybe default value should be session = false ? |
Same issue. I have many logs with this problem. I use php 8.1.27, DropZone 5.9.3, Laravel 8.40. When the last chunk (for example, 5 out of 5) is uploaded, the file assembly begins, even if not all chunks have been uploaded yet (for example, 4 out of 5). It is the condition of loading the last chunk that is checked here. laravel-chunk-upload/src/Save/ChunkSave.php Line 166 in cfbc429
I see the following error in the logs:
Payload of the last request containing an error: {
"dzuuid": "62008064-10f1-4eed-b559-4bb02dcb5454",
"dzchunkindex": "8",
"dztotalfilesize": "122219582",
"dzchunksize": "10000000",
"dztotalchunkcount": "13",
"dzchunkbyteoffset": "80000000",
"_token": "********",
"video": {
"name": "some-file-name.mp4",
"size": "0"
}
} idk how to solve this problem with code. This is the first time I've encountered chunks. Now I'm looking for the DropZone option to send the last chunk only after unloading all the others. Unsuccessfully I will be grateful for any help 🙏 UPD: I found such a solution #91 (comment). It should work intuitively. I will write about the results – |
Maybe would be useful for someone. Here is my working example from frontend side. async addLarge ({ commit, state }, file) {
const size = 1024 * 1000
const chunks = Math.ceil(file.size / size)
const chanked = []
for (let i = 0; i < chunks; i++) {
chanked.push(file.slice(
i * size, Math.min(i * size + size, file.size), file.type
))
}
if (chanked.length === 0) {
return
}
let i = 0
const t = chanked.length
while (chanked.length > 0) {
const form = new FormData()
form.append('chunk', i)
form.append('chunks', t)
form.append('file', chanked.shift(), file.name)
await this.$axios.post(
'YOUR_URL',
form
)
.then((res) => {
// Do something
})
.catch((e) => {
console.error(e.response)
})
i++
}
}, |
the file i upload use dropdown js with chunk is corrupted, the last chunk not merged.
i use laravel 8
The text was updated successfully, but these errors were encountered: