Create intermediate Works with: Claude, Gemini, ChatGPT

File Upload Feature Implementation

Interview first Needs file upload / long context

Build safe uploads with previews and limits.

The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.

Rate this prompt

Loading ratings…

Before writing code, interview me about the upload feature I need. Ask one question at a time and wait: (1) purpose and file types, (2) maximum file size and number of files, (3) stack (frontend, backend, storage), (4) who can upload and view files, (5) whether files need preview, processing, or scanning, (6) whether uploads happen on poor connections, (7) privacy and retention requirements.

What I have so far: [CURRENT_STACK_AND_NOTES].

Then deliver the implementation:
1. Design summary: flow diagram in text from selection to storage, including direct-to-storage uploads with signed URLs if appropriate and the reasons.
2. Frontend code: accessible file input with drag and drop as an enhancement, keyboard operation, preview, progress, cancel, retry, validation messages, and status announcements for screen readers.
3. Backend code: validation of size and content type by signature, safe generated names, storage outside the web root, authorization checks, and rate limits.
4. Safety: malware scanning hook, image re-encoding, quota, and cleanup of orphan files.
5. Tests: valid file, wrong type, oversize, interrupted upload, and unauthorized access.
6. A list of settings to tune and the failure modes to monitor.

Comment the code where the security reasoning matters.

Fill in before use

Optional: type your details and the prompt above updates. Nothing is saved or sent.

Replace each bracketed placeholder with your own details, then paste into Claude, Gemini, ChatGPT or another assistant.

Related prompts