Tag: uploads

  • Clients Who Upload Huge Photos & Decompression Bombs

    Sometimes a client makes a blog post, and puts a photo in the middle. All good so far, until you realise the client has dragged an image from their brand new camera expecting a 10 Megapixel image to work. This is usually when people start talking about upload max file size limits, but this is…

  • Emailing on Image Attachment Uploads

    Sometimes it’s useful to know when an image or audio attachment is added. Here I’ll outline how to send an emailwhen it happens. How It Works We start by hooking into add_attachment, and grabbing the user IDs of all administrators: // send to admins of the current blog/site $args = array(); $args[0] = ‘user_email’; $wp_user_search…

  • Creating an Attachment for a File Already In Place

    There may come a time when there is a file in your uploads folder with no matching attachment post in the database. As unlikely as this is, it could happen, and when it does, it’s not clear how the upload mechanisms work. I came across a similar problem myself, here’s my code: View the code…