Closed ThomasWestrelin closed 3 years ago
Can you add quotes around the filename.
I've added quotes and It works well. Thank you.
It seems to be a problem on Laravel with the function response()
.
public function load(String $uniqid) {
$file = File::where('uniqid', $uniqid)->first();
return response(Storage::cloud()->get($file->path), 200)
->header('Content-Type', 'image/png')
->header('Content-Disposition', 'inline; filename="' . $file->name . '"')
->header('Content-Length', $file->length);
}
Sorry to re-open this but I'm having a very similar problem.
Loading the file with the load function, calling an url that respond with the file and the content disposition inline and the filename.
I can download the file and the name will be correct, but the filepond element does not show the filename.
Instead of getting "dummy.pdf" it shows "undefined"
I've tried the solution provided instead of the default content disposition from Symfony, in order to add the quotes:
But it's exactly the same
vue-filepond : 6.0.3 filepond : 4.30.3
Is it broken in version 6 or am I having another bug here ?
@Zack-Strife what does your FilePond server
property look like?
data: function () {
return {
fileLoaded: false,
myFiles: [],
server: {
url: '/api/upload-sf/filepond',
process: '/post',
load: '/get/',
revert: './revert',
restore: './restore/',
}
}
},
Also I noticed that the file name is actually correctly get by the component somewhere since the
Thanks, managed to find out that it comes from the filepond-plugin-get-file thanks to those 👍
For anyone else with the same problem, there's already an issue over there with an open PR: https://github.com/nielsboogaard/filepond-plugin-get-file/issues/6
Describe the bug When the event "load" is called to restore uploaded server files, the filename is not used.
It used the source of the filepond object.
You can see that I use Content-disposition specified in documentation.
Server-side (PHP - Laravel)
Files Array of objects return by the server at init of the component.
FileComponent.vue
Expected behavior
I expect to see "base.png".
Information about the project: