tus / tusd

Reference server implementation in Go of tus: the open protocol for resumable file uploads
https://tus.github.io/tusd
MIT License
3.05k stars 475 forks source link

Files are not stored in the path mentioned in pre-create hook #1173

Closed sdanielv closed 3 weeks ago

sdanielv commented 1 month ago

Describe the bug Uploaded file is not stored in the path mentioned in pre-create hook, only info file is stored in the correct path.

To Reproduce Steps to reproduce the behavior:

  1. Start tusd with http hooks enabled and pre-create hook set up as per documentation (eg below)
  2. Upload a file
  3. Check the path where the uploaded file is stored on disk

Expected behavior According to tusd documentation -

if the pre-create hook returns the following hook response, an upload with ID project-123/abc is created, the info file is saved at ./uploads/project-123/abc.info, and the file content is saved at ./uploads/project-123/abc/presentation.pdf

{
    "ChangeFileInfo": {
        "ID": "project-123/abc",
        "Storage": {
            "Path": "project-123/abc/presentation.pdf"
        }
    },
}

But setting the exact same values results in info file stored as project-123/abc.info and uploaded file stored as project-123/abc. As per documentation shouldnt the uploaded file be stored as project-123/abc/presentation.pdf? Not sure if im missing some other setting needed to achieve this.

Setup details Please provide following details, if applicable to your situation:

Acconut commented 1 month ago

This feature is only available in the 2.5.0 release candidates (v2.5.0-rc1 and v2.5.0-rc2). The documentation is misleading in that it's already in the latest regular release v.2.4.0, which it isn't. Apologies for that.

sdanielv commented 1 month ago

thanks for clarifying. works as expected on the release candidates.

Acconut commented 3 weeks ago

https://github.com/tus/tusd/releases/tag/v2.5.0 is now released, so the documentation is accurate again. Thanks for reporting this!