Wrong `filename` shown and used in `FileUpload`

I have a custom disk where I encrypt the document at rest and using a Controller to authorize request and decrypt at rest. I am also using FileUpload Field to upload this documents. Upload, Encrypt/Decrypt and Controller works fine. In the controller I am returnin Conntent-Disposition and with filename but when FileUpload displaying the document it uses name attribute of Media which is fine if this was the problem but actuallu it just uses the last section of the url used to fetch the document. Name of the file becomes 13 which is the id of the Media record as well as the id used in the URL. But as you can see in the last screenshot filename is present. FilePond also uses headers to first determine the filename. I looked source code of the filament and other places but couldn't find any plausible place where the problem may originate.
No description
No description
No description
7 Replies
Zamion101
Zamion101OP2w ago
Bump
Dennis Koch
Dennis Koch2w ago
Might be a Filepond thing
Dennis Koch
Dennis Koch2w ago
That's what we are using inside file-upload.js. Not sure where to tell Filepond which name to use. https://pqina.nl/filepond/docs/api/server/#load-1
Easy File Uploading With JavaScript | FilePond
A JavaScript library that can upload anything you throw at it, optimizes images for faster uploads, and offers a great, accessible, silky smooth user experience.
Dennis Koch
Dennis Koch2w ago
Maybe we need to implement headers(headersString);
Zamion101
Zamion101OP2w ago
FilePond does mention this to be implemented for it to be able to get the fileinfo from headers.
Dennis Koch
Dennis Koch2w ago
Where is this mentioned? I just saw the comment:
Can call the header method to supply FilePond with early response header string
Zamion101
Zamion101OP2w ago
It does not directly mention it to be implemented but https://pqina.nl/filepond/docs/api/server/#fetch this shows alternative where you can set up FilePond to send HEAD request and get the information from response headers.
Easy File Uploading With JavaScript | FilePond
A JavaScript library that can upload anything you throw at it, optimizes images for faster uploads, and offers a great, accessible, silky smooth user experience.

Did you find this page helpful?