Temporary Image Upload API

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.

1

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 preview
return { 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" />;
}
Image available for 24 hours
2

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

3

Save on form submission

Promote temporary image to permanent storage with your private API key.

// 3. Save temporary image after form submission
const 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 expire
return { imageUrl };
};
Image is now permanent and won't expire

Why Temporary Uploads?

Solve common image upload problems with smart temporary storage.

Prevent Storage Bloat
Abandoned uploads auto-delete after 24 hours. No manual cleanup required.
Instant Previews
Users see uploaded images immediately, improving form completion rates.
Secure by Default
Temporary uploads don't require authentication. Private key only for saving.
Better UX
Upload first, form later. Reduce friction in your upload flows.

Perfect For These Use Cases

Temporary uploads solve real problems in modern web applications.

Profile Picture Uploads

Users upload profile pictures during registration but may abandon the form. Temporary uploads prevent orphaned profile pictures.

Only save when registration completes
Product Listings

Sellers upload product images while creating listings. If they abandon the listing, images auto-delete instead of consuming storage.

Automatic cleanup of draft listings
Content Creation

Blog posts and articles with images. Writers can upload images while drafting, but only published content saves images permanently.

Draft images don't count against storage
Support Tickets

Users attach screenshots to support tickets. If they close the browser before submitting, images auto-expire instead of cluttering storage.

No orphaned support attachments