Jump to content

[SOLVED] checking filetypes


Ninjakreborn

Recommended Posts

I had a file handling program I built awhile back but ended up losing over time.  Now I have this half system to validate filetypes.  Is there a good/proven method that is really powerful that anywhere here uses to validate there filetypes.  Just a specific method that you have used for a long time, and you know work's really well.  I am going to come up with my own again, I just want some idea's on how to formulate it.  Thanks?

Link to comment
https://forums.phpfreaks.com/topic/36775-solved-checking-filetypes/
Share on other sites

So something like.

<?php
$accepted_types = array("gif",
                                   "jpg",
                                   "jpeg",
                                   "bmp");
if (!get_image_size($filename, $accepted_types) {
// not allowed
}else {
// do file stuff
}
?>

Is that about along the lines of what you mean?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.