ProStack provides an API for file uploads, powered by Vercel Blob storage. This API allows you to upload files and receive URLs to access them.

File Upload Endpoints

Upload File

POST /api/upload
Content-Type: multipart/form-data

// Form data with 'file' field containing the file to upload

This endpoint uploads a file to the Vercel Blob storage and returns metadata including the public URL to access the file.

Error Handling

If an error occurs during the upload process, the API will return an error response:

{
  "error": "Failed to upload file"
}

Common error scenarios:

  • No file provided in the request
  • Unsupported file type
  • File size exceeds limits
  • Storage service unavailable

Authentication Requirements

The upload API may require authentication depending on your application’s configuration. Make sure to include your authentication token if necessary:

Authorization: Bearer <your_token>

Supported File Types

ProStack supports the following file types for upload:

  • Images: jpg, jpeg, png, gif, webp
  • Documents: pdf, doc, docx, txt
  • Other media files as configured

Next Steps