Closed BuchholzTim closed 3 years ago
Thanks for the detailed issue. I wonder if chunkForce
would fix this?
Thanks for the reply and the nice workaround.
Setting chunkForce
fixes my particular problem. Perhaps I overlooked it in the documentation.
Glad to hear that :)
I'll close the issue for you.
@rikschennink I came across the same issue as @BuchholzTim, and found this behaviour confusing, especially that the docs don't mention this in the "Server configuration" section (https://pqina.nl/filepond/docs/api/server/#process-chunks), leaving me think that once I set chunkUploads
to true
(as mentioned in the docs) all files would follow the same process.
Perhaps adding a comment regarding this (and the chunkForce
option) in the "process chunks" section of the docs would save people time in the future (it would surely save me time not having to code a workaround for this :)
thanks for the great plugin, by the way!
Good point. I've added an additional entry to the server docs.
Describe the bug: Currently Filepond does not send the filename on the first Process-Request, if it's uploading a file, which has a filesize greater than
chunk-size
. I also need to apply two additonal headers to the requests (projectId, Authorization).Those two headers are easily applied by setting the
server
-Property to the followingcomputed
-Value:This applied my two custom headers additonally to everything filepond does on its own.
I tried setting the filename in the Process-Request by passing a Function instead of an Object to the
server.process.headers
-Value, as described in this Issue.The new code looks like this:
This Code works perfectly fine for any filesize greater than
chunk-size
. The first Process-Request receives all the necessary headers and all Patch-Requests afterwards also receive them.If the file however can be uploaded in one request (i.e.
filesize < chunk-size
), then the Process-Request does not receive my headers and in consequence is not authorized to upload to the backend.In fact, the
processHeaders(file, metaData)
-Function only gets called, when a Patch-Request will follow. On a single Process-Request, it won't even call the method.Information about your project: