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

Error 404 on file link click. #18407

Open
PeterKvayt opened this issue Feb 20, 2025 · 3 comments
Open

Error 404 on file link click. #18407

PeterKvayt opened this issue Feb 20, 2025 · 3 comments

Comments

@PeterKvayt
Copy link
Contributor

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

15.2.0

Bug summary

I have a document type Foo, which includes a property named "file" with the data type FileUploadField.

I created content of type Foo, uploaded a file in the "file" field, and clicked "Save and Publish". The uploaded file was saved in the folder "wwwroot/media/{kind of id}/{file name}". In the published version of the document, the file property contained the value "{kind of id}/{file name}".

Later, I removed the file from the content and clicked "Save". At this point, the saved version no longer contained a value for the file property. However, the published version still retained the previous file reference. Here’s the interesting part: the file was also deleted from the physical file system, meaning it no longer existed at "wwwroot/media/{kind of id}/{file name}". This creates a situation where the Save action affects the published state, even though saved and published states are meant to be independent.

As I understand it, the purpose of having separate saved and published states is to maintain different versions of the same content without affecting each other. One could argue that Umbraco is only responsible for managing property values, not the file system. However, if that's the case, shouldn't it avoid saving files to the physical file system in the first place? It seems Umbraco has partial responsibility—it handles saving but does not manage deletion correctly.

Is this the expected behavior, or is it a bug?

Specifics

No response

Steps to reproduce

  1. Fresh umbraco install
  2. Create doc type Foo with a property of FileUploadField
  3. Create content of Foo data type
  4. Upload the file and click "Save and Publish"
  5. Make sure the file has been saved and copy the file link
  6. Open file link in browser: file existed
  7. Click "Remove file(s)" button and click "Save"
  8. One more time open the file by copied link: 404 response

Expected result / actual result

The published version should retain its content regardless of any changes made to the saved version.

Copy link

Hi there @PeterKvayt!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@NguyenThuyLan
Copy link
Contributor

In my opinion, this might be a bug that we should fix.
I was able to reproduce it in v15.2..2 and v13.7.0-rc.

@PeterKvayt
Copy link
Contributor Author

@NguyenThuyLan
Thanks a lot, I think it is a bug too.

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

No branches or pull requests

2 participants