Get mimetype of file object
Hello, all,
This side project I'm working on is really pushing me to learn some new things (which I enjoy!); but I keep running into issues that _should_ be pretty simple to figure out.
This time, I need to detect the mimetype of an uploaded file _without_ saving it to the hard drive, and _not_ by the file extension.
CF11 on an Ubuntu Server (Trusty Tahr 14.04.4 LTS; no GUI, it's all CLI)
The process that I have has been mentioned in an earlier post in this forum: image(s) are uploaded to the server without being saved to the HD, and the system loops through each of the .tmp files to insert the binaries of the file(s) into an array so that I can insert them directly into a database.
But I would like to limit the acceptable mimetypes to strictly .gif, .jpg, and .jpeg.
Is there a way, as I loop through the .tmp files, to detect the mimetype so I can reject anything that isn't .gif, or .jpg/.jpeg? The binaries are first loaded into a variable and I'm using isImage() to make sure that it _is_ an image.
V/r,
^_^
