Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.