fatmart Posted January 28, 2008 Share Posted January 28, 2008 Hi. I searched over the internet and I found some scripts about uploading files with php. It stores the files in a folder and all. But what I want to do is actually have a list on the upload.php page (where my upload script is) of all the files I have uploaded in my folder. I want to be able to download them after too. Do you have any scripts to propose me or a link to a page that can explain me how to do it? Thanks and sorry for my english, it isn't my main language Quote Link to comment https://forums.phpfreaks.com/topic/88246-file-uploading-and-listing/ Share on other sites More sharing options...
only one Posted January 28, 2008 Share Posted January 28, 2008 Here's a little code I used to use. It should list all the files inside your directory. Hope it helps. <?php if($handle = opendir('dirctory/')) //EDIT TO YOUR DIRECTORY { while(false !== ($file = readdir($handle))) { if(($file == ".") || ($file == "..")){}else { $files .= "<tr> <td> $file </td> </tr>\n"; } } closedir($handle); } echo "<table> $files </table>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/88246-file-uploading-and-listing/#findComment-451601 Share on other sites More sharing options...
fatmart Posted January 28, 2008 Author Share Posted January 28, 2008 thank you only one, I'm already more advanced in my work.. now I only have to find how to be able to click and download.. if anyone have an idea, it would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/88246-file-uploading-and-listing/#findComment-451632 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.