Smart Temporary Uploads
Form abandonment creates orphaned images. Auto-expire uploads prevent storage bloat. Upload immediately, promote to permanent after form completion.
How Temporary Uploads Work
Upload first, commit later. Images auto-expire in 24 hours unless explicitly saved.
Upload to temporary endpoint
No authentication required. Upload immediately for instant preview.
// 1. Upload to temporary endpoint (no auth required)const uploadTemporary = async (file) => {const res = await fetch('https://api.icefiery.com/v1/upload-temporary-image/upl_07c1b6044f944e6f8c160',{headers: {'X-Original-Filename': file.name,},body: file,});const { temporaryImageUrl, imageId } = await res.json();// Image is available immediately for previewreturn { temporaryImageUrl, imageId };};// 2. Display image immediately (works for 24 hours)function ImagePreview({ imageId }) {const imageUrl = `https://res.icefiery.com/res/${imageId}?width=400&format=webp`;return <img src={imageUrl || "/placeholder.svg"} alt="Preview" />;}
User completes form
Image is available for preview and transformations while user fills out the form.
Profile Picture Preview
Image uploaded and ready for use
Save on form submission
Promote temporary image to permanent storage with your private API key.
// 3. Save temporary image after form submissionconst saveTemporaryImage = async (temporaryImageUrl, metadata = {}) => {const res = await fetch(`https://api.icefiery.com/api/v1/save-temporary-image`,{method: 'POST',headers: {'X-API-Key': process.env.ICEFIERY_API_KEY,'Content-Type': 'application/json',},body: JSON.stringify({temporaryImageUrl,metadata: {userId: 'user_abc',category: 'profile-picture',...metadata}}),});const { imageUrl } = await res.json();// Image is now permanent and won't expirereturn { imageUrl };};
Why Temporary Uploads?
Solve common image upload problems with smart temporary storage.
Perfect For These Use Cases
Temporary uploads solve real problems in modern web applications.
Users upload profile pictures during registration but may abandon the form. Temporary uploads prevent orphaned profile pictures.
Sellers upload product images while creating listings. If they abandon the listing, images auto-delete instead of consuming storage.
Blog posts and articles with images. Writers can upload images while drafting, but only published content saves images permanently.
Users attach screenshots to support tickets. If they close the browser before submitting, images auto-expire instead of cluttering storage.