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
Process: Custom-Headers not applied, when Filesize < Chunk-Size #193
Comments
Thanks for the detailed issue. I wonder if |
Thanks for the reply and the nice workaround. |
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 Perhaps adding a comment regarding this (and the 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:
The text was updated successfully, but these errors were encountered: