bassguru Posted September 7, 2009 Share Posted September 7, 2009 Hello everyone, I have an application that allows users to save images to the server. The code below demonstrates this: //Give image file a unique name (username+(unix)time.extension) $image_name=$username.''.time().'.'.$extension; //Define directory where image will be stored $newname="images/".$image_name; //Upload the image to the server ... As you can see, the image name is changed so it is uniquely defined. The username of the person is used as well as the unix epoch time (in seconds) to make sure of this. What I now want to do is search the folder on the server for certain images that belong to the logged in user. For example, 'user01' logs on, so all the images with the file names beginning with 'user01' are displayed (the unix time is not required; it is purely there to uniquely identify each file). The problem is I have no idea what PHP function lets the application select files, let alone the ones beginning with a predefined username! Any advice or code is welcome. Many thanks in advance bassguru Link to comment https://forums.phpfreaks.com/topic/173462-retrieve-certain-files-from-server/ Share on other sites More sharing options...
bundyxc Posted September 7, 2009 Share Posted September 7, 2009 You should be able to find what you're looking for in the PHP Directory Functions. Link to comment https://forums.phpfreaks.com/topic/173462-retrieve-certain-files-from-server/#findComment-914372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.