Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Reading a directory question
11-02-2006, 05:13 PM #1
- 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.
11-02-2006, 09:26 PM #2
- Join Date
- Aug 2003
- One step ahead of you.
- Thanked 3 Times in 3 Posts