Skip to content
Advertisement

Tag: upload

PHP – Uploading multiple files

I’m working on a plugin for wordpress and I want to be able to upload multiple pictures from a form. Right now when I have a form for two pictures and submit it empty, my $_FILES array looks like this: Now the problem is that I want to use wordpress’ upload handler, wp_handle_upload. It expects the $_FILES array as an

How to gracefully handle files that exceed PHP’s `post_max_size`?

I’m working on a PHP form that attaches a file to an email, and trying to gracefully handle cases where the uploaded file is too large. I’ve learned that there are two settings in php.ini that affect the maxiumum size of a file upload: upload_max_filesize and post_max_size. If a file’s size exceeds upload_max_filesize, PHP returns the file’s size as 0.

Advertisement