Check whether uploaded file is directory or not

Hi all,

I use a http://tutorialzine.com/2011/09/html5-file-upload-jquery-php/ for file uploading.

I wanted to check on the server side whether the uploaded file is an actual file or a directory. I tried the following without success:

This returns text/plain for folders:


finfo_file($finfo, $_FILES['tmp_name']);

This returns false for files and folders (tmp_name is something like /tmp/12Sdfds2 for folders):


is_dir($_FILES['tmp_name']))

What else can I try?

Thanks…

Maybe I’m missing something…but I never heard of a browser uploading whole directories or directories in general…Firefox doesn’t even let me select a directory to upload, it only opens it.

On my Mac I can drag and drop a folder in FireFox and it gets processed but not the way it should because the script is expecting a file.