Important uploader changes

There are a few Uploader changes that I made this week that everyone should be aware of. Simple change logs will not suffice, so I will briefly talk about the changes.

Why not a minor version upgrade?

You're right, it should be a minor version instead of a patch. I was trying to be hasty and screwed that up and now it's too late. This post is also to warn anyone updating via Composer without checking the changes.

Amazon S3 endpoints

Last week Amazon changed their AWS SDK and in the process broke the S3 URLs (endpoints) that are generated via the Uploader and Transit. I quickly fixed this once it was brought to my attention, however, if anyone was uploading files during this time frame, the S3 transport would of failed and will continue to fail until Transit is updated.

Imported file validation

File validation up to this point was only for literal file uploads and not imports. After many requests I decided to add file validation to importing files. The process and configuration should be the same for both uploads and imports. I also updated Transit to import files under https.

Extension detection

In the past, the extension of a file was determined by the ending characters in the literal filename. This was changed and it will now determine the extension based off the files mime type (image/jpeg = jpg, etc). This provides support for files that do not have extensions, but are true files (primarily applies to URLs).

Swapped type/mimeType validation rules

These 2 validation rules continue to confuse people, and it confused me also as the terminology is backwards. I decided to swap the functionality of these, which in turn will break backwards compatibility. The way these should work is as so:

If type equals "image" then all image mime types will pass (image/jpeg, image/png, etc). This allows for easy validation of all images instead of defining mime types for each one. The type value can be anything before the / in the mime type declarations.

As for mimeType, this should equate to the literal mime type value: image/png, text/html, audio/mp3, etc.

I may combine these into a single validation rule to remove the confusion that they cause.

Upgrade now!

Please update to Uploader v4.0.9 and Transit v1.0.7 immediately, especially if you are using Amazon S3.