dcasia / nova-filepond

A Nova field for uploading File, Image and Video using Filepond.
MIT License
48 stars 27 forks source link

Add keepOriginalFilename functionality to retain the uploaded filename #13

Closed gabe565 closed 11 months ago

gabe565 commented 4 years ago

Add keepOriginalFilename flag that retains the original filename between the upload request and when the resource is actually saved.

Adds a meta json file which is associated with an upload to reconstruct the original path.

Relates to #10

milewski commented 4 years ago

Hey @gabe565 , thanks for this PR, I had been working on a rewrite of this package extending the original File field from nova which would give the exact same API as the original File/Image field, I expect to be done with it later this week.

So on this new version instead of sending only the path through that weird encrypted string from the FilepondController im sending more info such as Original Name, Size, Path, Mime etc... so no need to store a JSON on disk and later retrieve it back, I think is a cleaner solution

gabe565 commented 4 years ago

That will be good. I intended for this to be a fix until that sort of thing could happen anyways, so if you plan to have it done soon that would be awesome!

royduin commented 4 years ago

Any updates?

sanderbaas commented 4 years ago

@milewski This package is very useful and I enjoy using it, but it would be even better if we could retain the original filenames somewhere. Is this still in the pipeline?

paperscissors commented 3 years ago

@gabe565 have you had any luck with this patch? doesn't seem to work for single or multiple files over here unfortunately :(

gabe565 commented 3 years ago

Hm that's strange. I've been using it since I created it on a site with multiple file uploads. My definition looks like this if it helps at all:

Filepond::make('Attachments')
    ->disk(config('filesystems.default'), 'attachments')
    ->keepOriginalFilename()
    ->multiple()

I'm not sure why it's not working for you 😕 Do any errors get triggered?

paperscissors commented 3 years ago

Ahh, very weird. I used the same implementation. For multiple files it shows a hash for the filename just like the main branch, but I think behind the scenes it used the original file name to save because on page load it says it can't find the files.

If I remove multiple() I get this head scratcher of an error when I try to save the form:

image

milewski commented 11 months ago

Hi, the latest version now supports Nova4 and it extends the official file field, so it supports everything the official field can do, this PR is no longer needed so I'm closing it.

v1.0.0