Public
Like
Image_uploader
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A 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.
Key Features:
- Generates permanent, shareable image URLs
- Images stored in Val Town's blob storage (powered by Cloudflare R2)
- 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.
This remix extends that foundationc with:
- Persistent blob storage instead of just echoing the file back
- 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