Skip to content

tracks= in teddycloud content api seems to be ignored leading to Downloaded ZIP archive (Tonie --> multiple ogg) cannot be opened by Windows Explorer #350

Open

Description

@henryk86

ZIP archives created/downloaded by TeddyCloud can be reported as invalid by Windows Explorer.

Windows shows the following error when opening the downloaded archive:
The folder cannot be opened.
The ZIP-compressed folder is invalid.

Steps to reproduce

  1. Download a tonie using the new track download functionality from TeddyCloud that is provided as a ZIP archive.
  2. Save the generated ZIP file.
  3. Open the ZIP using the built-in Windows Explorer ZIP support.

Actual behavior
Windows refuses to open the archive and reports it as invalid.

Expected behavior
The generated ZIP archive should be standards-compliant and open correctly with the built-in ZIP support of Windows as well as other common ZIP tools.

Additional notes
The generated ZIP structure should be checked for compatibility with Windows' built-in ZIP implementation, especially:

  • ZIP central directory / end-of-central-directory records
  • file sizes and offsets
  • compression method
  • filename encoding
  • data descriptors
  • archive finalization before the download is completed

It would also be useful to verify the same generated archive with tools such as 7-Zip or unzip -t to determine whether the archive itself is malformed or whether a ZIP feature unsupported by Windows Explorer is being used.

Image

Example file:
Traveltonie.zip

Activity

  1. henryk86 commented on Oct 16, 2026

    @henryk86
    CollaboratorAuthor

    @ditschi: You might have a look here.

    Maybe this issues should be moved into the teddycloud repo

  2. henryk86 commented on Oct 16, 2026

    @henryk86
    CollaboratorAuthor

    the size of the zip with a few tracks only is equal to the size of the download of the whole tonie as ogg.

  3. henryk86 commented on Oct 16, 2026

    @henryk86
    CollaboratorAuthor

    Investigated some more... the zip file is actually the whole ogg, just named as zip. The API does not deliver the expected zip file when passing &tracks=2,3,4

  4. ditschi commented on Oct 16, 2026

    @ditschi

    interesting on my ubuntu machine in the docker testenv extracting the zip worked.

    but maybe some rework broke something (i did only verify this once and as i did not change anything where i expected this to break i didn't repeat that verification.

    I am currently building to verify this again. If this is a windows only issue then i can only ask the llm to suggest a fix but i won't manage to verify myself as i do not own ans machines running windows.

  5. ditschi commented on Oct 16, 2026

    @ditschi

    Thanks @henryk86 , the investigation helped.

    Result on our side: we can’t reproduce this on Linux with current develop. On Ubuntu a manual download of a multi-track selection (…?ogg=true&tracks=2,3) returns a proper application/zip. unzip -t is clean, and extraction and playback of the tracks work. tracks=2 returns a single Ogg as expected, and the web client builds the URL the same way.

    Your file: Traveltonie.zip starts with OggS, so it is the full Ogg stream, not a malformed zip. Windows is right to reject it. That matches your finding that tracks= was ignored.

    Open question: which backend served that request? Are you sure teddycloud#484 (track export) was merged in the version used on your side. Could it be that the web UI and the teddycloud binary came from different builds? If you can, please check the build or commit of the exe or container that answered.

    Separate Windows risk: the backend builds the zip by running an external zip binary (handler_api.c, osSpawnvp("zip", …)). That’s present in the Docker images, but a native Windows install might have no zip on PATH, so multi-track download would likely fail there. We haven’t been able to verify it on Windows yet.

    Proposal: write the zip in-process. It would be store-only, since Ogg is already compressed, with no new dependency and about 100 lines including CRC32. It would work the same on all platforms. We’d add a test and have the windows-latest CI job start the exe and run it, because I personally have no Windows machine. Unless you’d prefer to keep zip as an external requirement and show a UI hint when it’s missing, we’ll go with the in-process version.

  6. henryk86 commented on Oct 17, 2026

    @henryk86
    CollaboratorAuthor

    i am running the current develop (pulled yesterday evening, now again without any change).
    --> TeddyCloud vX.X.X (e5fac5c) - 2026-10-16 10:39:18 +0000 ubuntu linux-x86_64(64)
    --> https://github.com/toniebox-reverse-engineering/teddycloud/tree/e5fac5ca1e27e7479438783f32193ec6fd02b25b
    which contains:
    Image

    the issue is not windows. the ubuntu server returns a ogg file ("500304E0" no file ending) if i call the api call manually. not the expected zip.

    Maybe something else answers the request before the new function can answer it?

    the complete call (copied from the network tab, removed specific data): https://ABC/content/download/A64E581D/500304E0?overlay=AAAAAAAAAAA&skip_header=true&ogg=true&tracks=10%2C11

    If the web ui creates / uses a wrong link... please give me the right expected link. I modified the code around a bit: 0431fa4 (but the issue happens also on the unmodified teddycloud develop version)

    Docker logs:
    INFO |handler_cloud.c:0483:getTonieInfoForRequest()| >> client requested content for rUID a64e581d500304e0, auth 00000000...
    INFO |handler_cloud.c:0758:handleCloudContentExt()| Serve local content from /teddycloud/data/library/taf/xxx/xxxxxxxxxxx.taf

  7. changed the title [-]Downloaded ZIP archive (Tonie --> multiple ogg) cannot be opened by Windows Explorer[/-] [+]tracks= in teddycloud content api seems to be ignored leading to Downloaded ZIP archive (Tonie --> multiple ogg) cannot be opened by Windows Explorer[/+] on Oct 17, 2026
  8. henryk86 commented on Oct 17, 2026

    @henryk86
    CollaboratorAuthor

    I think i found the problem.

    Its the place you do it.

    • It works fine if you are in the library on a taf file, then the checked tracks are downloaded as a zip.
    • If you are in tonies overview or content folder, in general everything based on a json with no tafheader, the issue occurs.

    (btw. the download of 500304E0.json files are now saved as oggs...)

  9. henryk86 commented on Oct 18, 2026

    @henryk86
    CollaboratorAuthor

    With the help of ChatGPT, I was able to fix the issues.

    Issue 1: TonieInformationModal in the Content section (.../tonies/content) when opened for a 500304E0.json file
    → 6b6595c
    Issue 2: TonieInformationModal in the Tonies overview
    → c82c70d
    Issue 3: TonieInformationModal opened from the audio player
    Track selection was not possible because selected tracks were reset on every re-render. The same also happened when the screen size changed.
    → ec0200d
    Issue 4: 500304E0.json filedownload loads the json as ogg file
    → a29e265

    Tested:

    • cache to lib disabled: Tonie info opened from the 500304E0 file without a file extension in the Content section → downloads the expected data
    • Existing 500304E0.json in the Content section → downloads as expected
    • Tonies overview: Tonie with cache to lib disabled → works as expected
    • Tonies overview: Tonie with a linked TAF file in the library → works as expected
    • TonieInformationModal opened from the audio player → track selection works as expected and remains selected across re-renders / screen size changes
  10. self-assigned this
    on Oct 18, 2026
  11. henryk86 commented on Oct 18, 2026

    @henryk86
    CollaboratorAuthor

    @ditschi : maybe you can have a look into the changes above.

    I found another bug with the taf splitting: toniebox-reverse-engineering/teddycloud#552

  12. ditschi commented on Oct 18, 2026

    @ditschi

    Thanks @henryk86, your debugging pinned it down. This is a backend bug, not Windows and not a build mismatch.

    Cause: The download from a Tonie card or the info dialog uses the tag's audioUrl, i.e. /content/download/<ruid>?overlay=…&skip_header=true&ogg=true&tracks=10,11. Your log (handleCloudContentExt … Serve local content) shows that this route is served by the cloud content handler. It never looked at tracks= and streamed the whole TAF as Ogg, which the client then saved under a .zip name. The File Browser route (/content/<file>.taf?special=library&ogg=true&tracks=…) does handle tracks=. That is why it worked in the library and why I couldn't reproduce it earlier.

    Fix: toniebox-reverse-engineering/teddycloud#553. /content/download/… now resolves the tag's source (e.g. lib://…) and uses the same track export as /content/…. A new test covers both routes with a tag pointing at a library TAF. It fails without the fix exactly as described here.

    Verified: With the fix, the tag's own audioUrl plus tracks=2,3 returns a zip with the two selected tracks. I checked this in the web UI of #348 against a local build of the fix.

    Not covered, separate PRs:

    Details on how this relates to the web changes are in the comment on #348.

  13. added this to the 0.7.1 milestone on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions