Skip to content

Preview API: expose supported file/MIME types via Capabilities endpoint #31267

Open

Description

@felix-schwarz

Clients targeting the Preview API at remote.php/dav/files/[user]/[file]?x=[width]&y=[height]&c=[eTag]&preview=1 have no way of telling in advance for which file types a preview can likely be expected to be available.

Ideally, a list of MIME types, for which the Preview API is likely capable of providing a preview, would be available as part of the capabilities endpoint.

Using that list, clients could then see if the MIME type of an item is in that list and only request thumbnails for those items for which this is the case.

Activity

  1. changed the title [-]Expose supported Preview API MIME Types [/-] [+]Expose file/MIME types supported by Preview API via Capabilities endpoint[/+] on Apr 25, 2018
  2. changed the title [-]Expose file/MIME types supported by Preview API via Capabilities endpoint[/-] [+]Preview API: expose supported file/MIME types via Capabilities endpoint[/+] on Apr 25, 2018
  3. ownclouders commented on Apr 25, 2018

    @ownclouders
    Contributor

    GitMate.io thinks the contributor most likely able to help you is @PVince81.

    Possibly related issues are #14106 (previews broken for non-supported file types), #7574 (Add to mime type list), #15124 (MPO support), #29076 (Add eml to list of known mime types), and #29158 (Dear Support, ).

  4. michaelstingl commented on Apr 30, 2018

    @michaelstingl

    Related docs:
    https://doc.owncloud.org/server/latest/admin_manual/configuration/server/config_sample_php_parameters.html#previews

    'enabledPreviewProviders' => array(
            'OC\Preview\PNG',
            'OC\Preview\JPEG',
            'OC\Preview\GIF',
            'OC\Preview\BMP',
            'OC\Preview\XBitmap',
            'OC\Preview\MP3',
            'OC\Preview\TXT',
            'OC\Preview\MarkDown'
    ),
    
  5. michaelstingl commented on Apr 30, 2018

    @michaelstingl

    Could the capability also include available formats of the preview itself?

    Example 1

    Source:

    • *.docx

    Available previews:

    • *.pdf
    • *.png

    Example 2

    Source:

    • *.r3d (Redcode RAW, from RED Digital Cinema Camera)

    Available previews:

    • *.png (static previews)
    • *.mp4 (video previews, could be played in browser or iOS app)

    Related:

  6. felix-schwarz commented on Apr 30, 2018

    @felix-schwarz
    Author

    Yes, this would be awesome. That way, clients could - in addition to knowing which files to request previews for - also pick the preview format they can process best.

  7. ownclouders commented on Jun 8, 2018

    @ownclouders
    Contributor

    Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

    (This is an automated comment from GitMate.io.)

  8. ownclouders commented on Jul 17, 2018

    @ownclouders
    Contributor

    Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

    (This is an automated comment from GitMate.io.)

  9. added this to the backlog milestone on Jan 16, 2019
  10. stale commented on Sep 20, 2021

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

  11. DeepDiver1975 commented on Jun 19, 2026

    @DeepDiver1975
    Contributor

    🤖 Automated issue analysis by Claude Code review agent.

    Classification: analysis-only (open, unimplemented enhancement)

    Summary of request
    This 2018 enhancement asks the Preview API to advertise, via the Capabilities endpoint, the list of file/MIME types for which a preview is likely available — so clients can decide in advance which items to request thumbnails for (and, per the follow-up comments, ideally which output preview formats are offered, e.g. png/pdf/mp4).

    Investigation — is it implemented today?
    I reviewed the capability classes that feed the OCS cloud/capabilities endpoint. None of them exposes preview-supported MIME types:

    • lib/private/OCS/CoreCapabilities.php — exposes only core (pollinterval, webdav-root, status, support-url-signing) and files.app_providers. No preview MIME list.
    • apps/files/lib/Capabilities.php — exposes checksums and files (privateLinks, bigfilechunking, blacklisted_files, favorites, file_locking_support, …). No preview MIME list.
    • apps/dav/lib/Capabilities.php — exposes only dav (chunking, reports, propfind, trashbin) and conditional async. No preview MIME list.
    • Other ICapability implementations (files_sharing, files_versions, files_trashbin) are domain-specific and do not relate to previews.

    The only place the supported preview MIME set is surfaced is core/js/config.php:

    'enabledPreviewProviders' => $previewManager->getSupportedMimes()

    This is injected into the web UI's client-side bootstrap config (the oc_capabilities JS blob), not the OCS REST Capabilities endpoint that external clients (the iOS/Android apps referenced in this issue) consume. It is therefore not a substitute for what this issue requests.

    Conclusion
    The requested feature — exposing the set of preview-capable MIME types (and optionally available output formats) through the public Capabilities API for programmatic clients — is still not implemented. The issue remains a valid open enhancement. It is consistent with its current labels (enhancement, technical debt) and OPEN state; no code change has landed that satisfies it.

    Note: owncloud/core is in maintenance/end-of-life status, with active development on the Infinite Scale (oCIS) platform. Maintainers may wish to indicate whether this enhancement is still in scope here or should be tracked against oCIS.

    (Read-only analysis; no repository changes were made.)

  12. dj4oC commented on Jul 9, 2026

    @dj4oC
    Contributor

    Implementation prompt

    Problem: The OCS cloud/capabilities endpoint does not expose which file/MIME types the Preview subsystem can generate thumbnails for. The only place the supported preview MIME set is surfaced today is core/js/config.php's enabledPreviewProviders (fed by $previewManager->getSupportedMimes()), which is injected into the classic web UI's client-side bootstrap config, not the public REST Capabilities API that external clients (iOS/Android/desktop) consume.

    Acceptance criteria:

    • The OCS cloud/capabilities response includes a list of MIME types (or patterns) for which a preview/thumbnail is available, sourced from the same PreviewManager::getSupportedMimes() used internally.
    • Existing capability fields and consumers are unaffected (purely additive).

    Files:

    • apps/files/lib/Capabilities.php — add a preview-related key (e.g. under files) populated from PreviewManager::getSupportedMimes(), following the existing pattern used for blacklisted_files, favorites, etc.
    • Alternatively/additionally lib/private/OCS/CoreCapabilities.php if this is judged to belong under core rather than files.

    Constraints:

    • Test coverage ≥ 85% on touched code (e2e preferred — run the tool, do not trust claimed %)
    • Commit signing: GPG signature + DCO Signed-off-by
    • Rebase onto base branch before pushing
    • No root-directory edits
    • ownCloud core is in maintenance with active development moved to Infinite Scale (oCIS) — maintainers may want to confirm this enhancement is still in scope for core vs. oCIS before implementation.

    🤖 Automated by Claude Code


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions