Discord Bot File Storage

Permanent File Storage for Discord Bots

Reliable file storage for Discord bots with fast global delivery.

Discord's attachment CDN was built to display chat messages, not to back a bot's data layer. Since Discord added signed expiry parameters (ex, is, hm) to cdn.discordapp.com links in 2024, any attachment URL you saved in a database eventually returns a 404 — the signature times out and the link dies. If your bot stores user avatars, generated images, moderation evidence, or ticket transcripts by stashing the raw Discord attachment URL, those references rot. Re-hosting the bytes on a dedicated store fixes this permanently.

The pattern is straightforward. When your bot receives a message with an attachment, fetch the bytes from message.attachments[0].url immediately (while the signature is still valid), then push them through the files.link three-call upload and persist the returned permanent CDN URL instead. That URL never carries an expiry token, so it can sit in your database for years and still resolve.

A discord.js sketch:

js
client.on('messageCreate', async (msg) => {
  const att = msg.attachments.first();
  if (!att) return;
  const bytes = Buffer.from(await (await fetch(att.url)).arrayBuffer());
  // 1) POST /v1/files/{folderId} -> { urls: [{ url, id }] }
  const meta = await api.post(`/v1/files/${FOLDER}`, {
    filesMetadata: [{ name: att.name }],
  });
  const { url, id } = meta.urls[0];
  // 2) PUT the bytes to the presigned URL
  await fetch(url, { method: 'PUT', body: bytes });
  // 3) confirm
  await api.post('/v1/files/confirm-upload', { ids: [id] });
  msg.reply(`Stored permanently: ${cdnUrlFor(id)}`);
});

The Authorization header is your raw API key (no Bearer prefix). Because the result is a plain public CDN URL, you can drop it straight into an embed's image field — Discord fetches it from the nearest edge, so it renders the same in Tokyo as in Frankfurt. Unlike Discord's per-message size ceiling (10 MB on the free tier, up to 100 MB with boosts), there's no per-message wall here: large renders, archived logs, or generated audio all upload fine.

Keep one project and API key per bot so you can revoke a single bot's access without disturbing the rest of your fleet.

Benefits With No Complexity

Global CDN delivery

Your files are served from 450+ edge locations worldwide.

Edge-cached worldwide

Files are cached close to your users for fast delivery.

Signed-URL security

Private files stay protected with time-limited access.

What You Get

Unlimited files

Upload as many files as you need.

Unlimited storage

There is no storage limit.

Public + Private storage

Private files are fully secured.

CDN ready links

Upload directly to 450+ edge locations worldwide.

Prepaid credits

No subscription. Pay only for the storage and bandwidth you use.

More coming soon

We have plenty of features coming!

How files.link Works

1. Upload

Create a project and upload your first file.

2. Copy

Copy the CDN link.

3. Use Anywhere

Paste and enjoy the blazing speed.

Why Developers Choose files.link

A Better Way to Store & Deliver Files

Discord Attachment CDNCloudflare R2Firebase Storagefiles.link
Permanent URLs (no expiry signature)
No per-message size ceiling
Global CDN delivery built in
Single REST API, no SDK required
Drop URL straight into an embed
Private files with signed URLs

Calculate Your Needs

Storage

0GB

Egress

0GB

CDN Bandwidth

0GB
Total: $0.000/month

Start Discord Bot Storage

  • Global CDN delivery
  • Edge-cached worldwide
  • Signed-URL security
  • Unlimited files
  • Unlimited storage
  • Public + Private storage
  • No subscription — prepaid credits keep spend predictable
Start Discord Bot Storage

Frequently Asked Questions

Why do Discord attachment URLs stop working?
Since 2024 Discord signs cdn.discordapp.com links with expiry parameters (ex, is, hm). Once the timestamp passes, the URL 404s. Any attachment link you saved in a database eventually breaks. Re-hosting the bytes on files.link gives you an unsigned permanent CDN URL that never expires.
How do I move an attachment into permanent storage?
Fetch the bytes from the attachment URL the moment your bot sees the message, then run the three-call upload: POST /v1/files/{folderId} to get a presigned PUT URL and file id, PUT the bytes, then POST /v1/files/confirm-upload with {ids:[id]}. Store the resulting CDN URL.
Can my bot serve files bigger than Discord's upload cap?
Yes. Your bot can't push past Discord's 10-100 MB per-message limit, but it can reply with a files.link CDN URL of any size. The user clicks and downloads directly from the edge, bypassing Discord's transfer limits entirely.
Where should the API key live in a Discord bot?
In an environment variable, never in code or your repo. Send it as the raw Authorization header on the metadata and confirm-upload calls. Use a separate project and key per bot so you can revoke one independently.
General Questions
Is there a subscription?
No. files.link uses prepaid credits, so storage, bandwidth, and API usage are deducted from your balance as you go. The app explains the payment step before uploads are enabled — no monthly subscription and no per-user fees.
What is files.link?
files.link is a developer-first file platform that makes it simple to store, secure, and deliver files globally. It provides signed URLs, public/private access, and an API-first design so you can integrate file delivery into any app without the usual complexity.
How does billing work?
files.link uses prepaid credits. As you use storage, bandwidth, and API requests, credits are deducted daily. When your balance runs low, we automatically recharge it using your saved card. If an auto-recharge doesn't go through, your files and links stay put — you simply update your payment method or top up manually to keep going. No monthly subscriptions — just simple usage-based pricing.
How secure is my data?
All files are encrypted at rest and in transit. You can use signed URLs for private files, control access with permissions, and rely on enterprise-grade infrastructure for data protection.

Related

files.link
Copyright © 2026
All rights reserved
ContactGuidesGlossaryStatusLegal