SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Check whether uploaded file is directory or not

    Hi all,

    I use a http://tutorialzine.com/2011/09/html...ad-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:
    PHP Code:
    finfo_file($finfo$_FILES['tmp_name']); 
    This returns false for files and folders (tmp_name is something like /tmp/12Sdfds2 for folders):
    PHP Code:
    is_dir($_FILES['tmp_name'])) 
    What else can I try?

    Thanks...

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    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.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •