api/preview
Return an inline preview of a single file. The response is the preview content itself (image bytes, audio stream, truncated text, or an archive listing), not JSON. Previewable types: images, mp3/aac audio, text files, zip and tar archives.
URL:
HTTP Method:
- GET
Parameters:
- size - preview sizing hint.
-
Images: width in pixels (
480) orWxH(800x600); default480wide. -
tar archives: maximum number of entries to list (default
25). zip archives ignore size and always list the first 20 entries. - Audio (mp3/aac): ignored; use info / pic instead.
- Text files: passing size currently triggers an HTTP
500(server bug); without it, text previews return the first 512 characters.
-
-
info -
trueon audio files: returns JSON tag metadata (album,artist,title) astext/plain. - pic -
trueon mp3 files: returns embedded album art, or a placeholder image when the file has none.
Response:
-
200with an appropriateContent-Type(image/*,audio/mpeg,text/plain, …) andContent-Disposition: inline. Previews are cached for one month (Cache-Control: max-age). 404- unknown user, batch, or file, or no previewer for the file type.400- invalid size value or corrupt zip archive.502- image preview service unavailable.