/storage/buckets/{bucketId}/files/{fileId}/downloadAlcance files.readGet a file content by its unique ID. The endpoint response return with a ‘Content-Disposition: attachment’ header that tells the browser to start downloading the file to user downloads directory.
Parámetros
Sección titulada «Parámetros»bucketId string obligatorio
Storage bucket ID. You can create a new storage bucket using the Storage service server integration.
fileId string obligatorio
File ID.
token string
File token for accessing this file.
Acceso: clave de API con el alcance files.read o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).
Respuestas
Sección titulada «Respuestas»200Éxito400Parámetro inválido o faltante401Sin sesión, sin permiso en el recurso o clave sin el alcance404Recurso de la ruta no encontrado429Límite de peticionesTodo error llega como JSON con code, type y message: consulta Errores.
import { Client, Storage } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const storage = new Storage(client);
const result = storage.getFileDownload({ bucketId: '<BUCKET_ID>', fileId: '<FILE_ID>', token: '<TOKEN>', // optional});
console.log(result);import { Client, Storage } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const storage = new Storage(client);
const result = await storage.getFileDownload({ bucketId: '<BUCKET_ID>', fileId: '<FILE_ID>', token: '<TOKEN>', // optional});curl "https://cloud.owbase.dev/v1/storage/buckets/<BUCKET_ID>/files/<FILE_ID>/download" \ -H "X-Owbase-Project: <PROJECT_ID>" \ -H "X-Owbase-Key: $OWBASE_API_KEY"Sin cuerpo en la respuesta.
Las descripciones de esta página vienen de la especificación de la API del servidor (licencia BSD-3-Clause), en inglés, y los ejemplos vienen del generador de SDKs (licencia MIT). Los avisos completos están en el archivo NOTICE de los paquetes @owbase/web y @owbase/node.