Skip to content
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

Downloading files uploaded in forms does not work #396

Open
eekes opened this issue Sep 2, 2024 · 3 comments
Open

Downloading files uploaded in forms does not work #396

eekes opened this issue Sep 2, 2024 · 3 comments
Labels

Comments

@eekes
Copy link
Contributor

eekes commented Sep 2, 2024

Q A
Bug? yes
New Feature? no
Bundle Version 2.5.4
Sulu Version 2.6.4

Actual Behavior

When trying to download a file uploaded in a Sulu form from here:
Screenshot 2024-09-02 at 09 59 38

I get this error message:

Invalid file name "file" for media with ID "1950".

Expected Behavior

The file should be downloaded.

Steps to Reproduce

Upload a file in a Sulu form and try downloading is using the URL shown in the "Data" table

Possible Solutions

I think it has something to do with this change: https://github.com/sulu/sulu/pull/7535/files ?

@alexander-schranz
Copy link
Member

You are right we are currently not replacing the /file part correctly:

@rogamoore
Copy link

We noticed the same problem. A workaround is to navigate to the corresponding collection in the media management to download the files.

@alexander-schranz Could you please explain a bit more what you mean "we are currently not replacing the /file part correctly". I could try a PR - but not sure what needs to be done to fix it.

@alexander-schranz
Copy link
Member

@rogamoore I'm not sure yet how to solve this in a performant way yet as we don't have the filename here yet:

return \str_replace('{id}', $value, $this->getDownloadUrl());
to replace /file with the uploaded filename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants