Skip to content

Articles

Working guides to handling file uploads in PHP — the configuration that trips people up, the security decisions that matter, and the techniques behind a modern upload experience. Every example is plain PHP you can use without our component.

How to Upload Multiple Files in PHP

Handling the $_FILES array when a form posts several files at once, and the pitfalls of its unusual shape.

· 8 min read

PHP Upload Size Limits Explained

upload_max_filesize, post_max_size, memory_limit and the web-server caps that silently override them.

· 9 min read

PHP Upload Error Codes (UPLOAD_ERR_*)

Every value $_FILES['file']['error'] can hold, what actually causes it, and how to fix it.

· 7 min read

Secure File Uploads in PHP: A Checklist

Extension allow-lists, MIME verification, storage outside the web root, and the mistakes that lead to remote code execution.

· 11 min read

Uploading Large Files in PHP Without Timeouts

Why big uploads fail, how chunked transfer solves it, and what to do about memory and execution limits.

· 10 min read

Building an AJAX Upload with a Progress Bar

XMLHttpRequest upload events, FormData, and why fetch() still cannot report upload progress.

· 9 min read

Drag-and-Drop File Uploads in PHP

The DataTransfer API, a drop zone that works with the keyboard too, and wiring it to a PHP endpoint.

· 8 min read

Where to start

If you are building an upload form from scratch, read multiple file uploads first for the shape of $_FILES, then the security checklist before you accept anything from real users. If something is already broken, the error-code reference and the size-limit guide between them explain almost every upload failure in PHP.

For the experience side — progress bars, cancellation, drag-and-drop and files too large for a single request — see AJAX uploads with a progress bar, drag-and-drop uploads and large file uploads.