Solar Posted January 1, 2009 Share Posted January 1, 2009 Hello Once again, my favourite site to ask PHP Questions. I've looked all over but it's hard to google a specific question. Is there a script that will allow me to view a folder in my computer if my website/apache is running off my own computer? Like lets say if I made a "page" for people to upload there files, is there a way to display all the files for them? Or like if I wanted to display pictures on my website but keep the pictures in the "My Picture" folder of my computer? Like this browser for example; http://beta.armagetronad.net/resource-browser/resource/ Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/139114-solved-important-question/ Share on other sites More sharing options...
Brenden Frank Posted January 1, 2009 Share Posted January 1, 2009 I'd use readdir(). Here's an example of a directory reader for a template chooser. This assembles an array that will be passed off to a builder class that assembles a dropdown menu with the array items produced by this code. // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if (($file != ".") && ($file != "..") && ($file != "Download")) { $template_options[$i] = $file; $i++; } } closedir($dh); } } Quote Link to comment https://forums.phpfreaks.com/topic/139114-solved-important-question/#findComment-727579 Share on other sites More sharing options...
bubbasheeko Posted January 1, 2009 Share Posted January 1, 2009 You mean you want to have your website pull the pictures directly from your computer and not the server? Well technically you would need to store your pictures on your server. So for it being a local server - you would need to have a directory within the folder/directory structure of the web server running on your computer. Your locally ran web server would have no 'rights' to browse outside of the 'server realm'. That would be a huge security risk. There are ways that you can browse your computer locally and upload the file to your server folder, but this is not what you are looking for. Quote Link to comment https://forums.phpfreaks.com/topic/139114-solved-important-question/#findComment-727581 Share on other sites More sharing options...
Solar Posted January 1, 2009 Author Share Posted January 1, 2009 You mean you want to have your website pull the pictures directly from your computer and not the server? Well technically you would need to store your pictures on your server. So for it being a local server - you would need to have a directory within the folder/directory structure of the web server running on your computer. Your locally ran web server would have no 'rights' to browse outside of the 'server realm'. That would be a huge security risk. There are ways that you can browse your computer locally and upload the file to your server folder, but this is not what you are looking for. Okay, lets not worry about the out side the server question. I've made a script that will allow users to upload there files to my website, but only with my permission. With the site I gave you, I want to be able to see all the peoples names, and their folders. I've allready made their folders.. so the my site would have.. sitelink/files/theusername/ So instead of me having to update the page with the new user all the time, is there a browser script that will allow me to see everyones folder at once? Quote Link to comment https://forums.phpfreaks.com/topic/139114-solved-important-question/#findComment-727587 Share on other sites More sharing options...
DarkerAngel Posted January 1, 2009 Share Posted January 1, 2009 Depending on your ISP, and network settings it is possible to have your local computer act as a web server, I have my own personal web server online that I use to test scripts and demo scripts that I'm developing for clients. Me personally I use No-IP as a DNS server cause their sub-domains are free. All I can understand from your question is that you possibly have apache/windows running off your local computer and are wondering if there is some script you can use to display contents of a folder on your local computer this is entirely possible. I have all the music shared on my local test server. I can demonstrate: http://darkangel.sytes.net/music/ this is so I can listen to my music where ever I am. Quote Link to comment https://forums.phpfreaks.com/topic/139114-solved-important-question/#findComment-727597 Share on other sites More sharing options...
Solar Posted January 1, 2009 Author Share Posted January 1, 2009 Depending on your ISP, and network settings it is possible to have your local computer act as a web server, I have my own personal web server online that I use to test scripts and demo scripts that I'm developing for clients. Me personally I use No-IP as a DNS server cause their sub-domains are free. All I can understand from your question is that you possibly have apache/windows running off your local computer and are wondering if there is some script you can use to display contents of a folder on your local computer this is entirely possible. I have all the music shared on my local test server. I can demonstrate: http://darkangel.sytes.net/music/ this is so I can listen to my music where ever I am. This is what I was looking for, Maybe I can fiddle around and get exactly what I need. Zina. Thanks a lot! Quote Link to comment https://forums.phpfreaks.com/topic/139114-solved-important-question/#findComment-727599 Share on other sites More sharing options...
redarrow Posted January 1, 2009 Share Posted January 1, 2009 You can access any files on any pc, if it on your own network, As long as you got php running on one computer.. I got my localhost computer http, setup with 10 different server's and i can access all of them via the web server. all i do is create a php script, To access the folders i want to see. it very straight froward. To be honest i even got into ftp and curl and soup, And can even access computer files outside my personal web server. if you got a dynamic ip, Meaning a ip that changes often, Then your need to use a dns service to point back you your ip. This cretes a static ip using the dns service, each time your ip changes, You can use a client software to update you dynamic ip to the dns service provider. Quote Link to comment https://forums.phpfreaks.com/topic/139114-solved-important-question/#findComment-727603 Share on other sites More sharing options...
DarkerAngel Posted January 1, 2009 Share Posted January 1, 2009 This is what I was looking for, Maybe I can fiddle around and get exactly what I need. Zina. Thanks a lot! Zina, is just for music files, but there is something else I could recommend PHPFileNavigator, which is something I need to implement into my site, is a decent file manager for PHP its not the best but it works well enough for me. And its free GPU license so. And like redarrow said you can do stuff like that if you own the network, but some non-business ISP's do block the port 80. Quote Link to comment https://forums.phpfreaks.com/topic/139114-solved-important-question/#findComment-727606 Share on other sites More sharing options...
redarrow Posted January 1, 2009 Share Posted January 1, 2009 If it blocked use port 8080 lol. shhhhhhhhhhhh Quote Link to comment https://forums.phpfreaks.com/topic/139114-solved-important-question/#findComment-727608 Share on other sites More sharing options...
DarkerAngel Posted January 1, 2009 Share Posted January 1, 2009 If it blocked use port 8080 lol. shhhhhhhhhhhh lol I thought I had to do that because for some reason I couldn't access my site through the IP settings but come to find out that I cant do the port forwarding through my local network so I have to use my local IP. and lucky for me my port 80 is untouched yet my ISP is against people hosting their private web servers. Quote Link to comment https://forums.phpfreaks.com/topic/139114-solved-important-question/#findComment-727613 Share on other sites More sharing options...
redarrow Posted January 1, 2009 Share Posted January 1, 2009 Sorry solar for butting in........ my ip hates you hosting web site on there ip as well, But guess what one day they said ok you use a web server i won lol ye haaaaaaa i thort, But guess what they did and it upset me, buggers blocked the out going mail port 25 lol. still got no luck getting around it. Quote Link to comment https://forums.phpfreaks.com/topic/139114-solved-important-question/#findComment-727617 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.