Skip to content

Error 404 on file link click. #18407

Open
@PeterKvayt

Description

@PeterKvayt

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy