A simple, elegant image hosting solution built on Val Town's blob storage. Upload images and get permanent, shareable URLs instantly.
This val provides a web interface for uploading images to Val Town's blob storage and generates permanent URLs that you can use anywhere - in documentation, websites, social media, or anywhere else you need to host images.
Key Features:
- π€ Simple drag-and-drop upload interface
- π Generates permanent, shareable image URLs
- πΎ Images stored in Val Town's blob storage (powered by Cloudflare R2)
- π¨ Clean, modern UI with gradient design
- π± Fully responsive for mobile and desktop
- Upload: Select an image file (PNG, JPG, GIF, WebP)
- Store: The image is saved to Val Town blob storage with a unique timestamped key
- Share: You receive a permanent URL in the format:
https://your-val.web.val.run/image/img_timestamp_filename.png - Use: Copy the URL and use it anywhere you need
- Images are stored in Val Town's blob storage, which is backed by Cloudflare R2
- Each upload gets a unique key:
img_[timestamp]_[filename] - Images are cached with a 1-year cache header for optimal performance
- All images in your account can be managed at: https://www.val.town/settings/blob
- File size: ~1MB per upload (Val Town form upload limitation)
- Total storage:
- Free tier: 10MB total
- Pro tier: 1GB total
- File types: Images only (PNG, JPG, GIF, WebP, SVG)
- For files larger than 1MB, consider uploading to another service first, then fetching server-side
This val is a remix of @stevekrouse/fileInputUploadExample, which demonstrated the basic pattern for file uploads with Hono and Val Town.
The original example showed how to set enctype="multipart/form-data" on
forms - the critical step for file uploads. This remix extends that foundation
with:
- Persistent blob storage instead of just echoing the file back
- Image-specific handling and content-type detection
- A polished UI with helpful user information
- Permanent URL generation for uploaded images
- Fork this val to your own Val Town account
- Visit your val's endpoint (it will have a URL like
https://yourusername-valname.web.val.run) - Upload images and copy the generated URLs
- Manage or delete uploaded images at https://www.val.town/settings/blob
Built with:
- Hono 3 - Fast web framework with JSX support
- Val Town Blob Storage - Built-in key-value storage backed by Cloudflare R2
- Standard Web APIs - FormData, File, and Blob APIs
The implementation properly handles:
- File to blob conversion
- Content-type detection from filename extensions
- URL encoding for filenames with special characters
- Cache headers for optimal CDN performance
Public domain / do whatever you want with it π