Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2005
    Thanked 0 Times in 0 Posts

    Reading a directory question


    I have a site with multiple users. They each have their own home folder. Inside this folder they have a upload_temp directory and a gallery directory.

    When they ftp images into their upload_temp directory, I need to (using php) look into that directory see if there are any files, grab them, insert info into my DB, then take the ImageID generated for each file and rename each file after the ImageID, move the file to the gallery folder and remove the temp file.

    So what I need to know is how do I

    1. look into a directory and see if there are files
    2. grab the names of all the files and place them into an array that I can loop through, inserting , rename, move and then remove.

    so if my directory name is upload_temp, is there a function in php that will read all the files uploaded and place the names into an array or something to that effect? I know how to rename and move files, I just need to know how to check the directory for files within and place them into an array.

    thank you for any help with this.
    Last edited by tripwater; 11-02-2006 at 05:15 PM.

  2. #2
    Senior Coder
    Join Date
    Aug 2003
    One step ahead of you.
    Thanked 3 Times in 3 Posts
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.


Posting Permissions

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