Documentation
How It Works
When you upload a file or paste text, a unique 4-character alphanumeric filename is generated (e.g., aB1c.png
or xY9z.txt
). You can use this filename to access your content through two different types of URLs.
URL Types
- Page URL:
/<filename>
The primary URL for sharing. It shows a preview page with file details, a download button, and rich embed tags for services like Discord or Twitter. - Raw URL:
/raw/<filename>
A direct link to the file's raw content. This URL will immediately start a download or display the content in the browser.
Password Protection
If a file is password-protected:
- Accessing its Page URL (
/<filename>
) will show a page where you must enter the password. Submitting the correct password will redirect you to the Raw URL for direct download. - Accessing its Raw URL (
/raw/<filename>
) directly will result in a401 Unauthorized
error. - To create a direct, shareable link for a password-protected file, you must use the format:
/raw/<filename>/<password>
. This link will bypass the password page and serve the raw content directly.
Rich Embeds (OpenGraph)
The server uses the Page URL (/<filename>
) to provide rich media embeds. When a bot (from services like Discord or Twitter) visits a Page URL, it receives special OpenGraph meta tags that create a link preview. Regular users visiting the same URL will see the file's preview page.
Authenticated users can customize embed content via the Dashboard.
API Reference
Endpoint: POST /api/upload
File Uploads
To upload a file, send a multipart/form-data
request.
Parameters
file
(file, required): The file data.secret
(string, optional): Your API key from your dashboard. Links the file to your account.password
(string, optional): Sets a file password.
cURL Example
curl -X POST \
-F "secret=YOUR_API_KEY" \
-F "file=@/path/to/image.png" \
-F "password=supersecret" \
https://fileb.in/api/upload
Text Pastes
To create a text paste, send a request with a text/plain
body and an X-Upload-Type: paste
header. Pastes are always saved as .txt
files.
Headers
X-Upload-Type
(string, required): Must be set topaste
.Authorization
(string, optional): Your API key. Note: This uses theAuthorization
header, not a form field.Password
(string, optional): Sets a file password. Note: This is a header, not a form field.
cURL Example
curl -X POST \
-H "X-Upload-Type: paste" \
-H "Authorization: YOUR_API_KEY" \
-H "Password: supersecret" \
-d "This is the content of my paste." \
https://fileb.in/api/upload
Success Response
For both file and paste uploads, a successful request returns a JSON object with the Page URL of the content.
{
"url": "https://fileb.in/aB1c.png"
}