I have a Simple file browser on my php, and everytime I enter Open index.php file in my localhost, the file appears, but when I upload them in my server, the file cannot be seen, I made all the file permissions to 777 and still no luck... I think i miss some codes.. could you guys help me.. please...

Here's the code that I was working on... I got this from Micro file Browser made by PHP Toys:

<?php

$path = "browse/videos/";

function showContent($path){

if (is_dir($path)) {

   if ($handle = opendir($path))
   {
      while (false !== ($file = readdir($handle)))
       {
           if ($file != "." && $file != "..")
           {
               $fName = $file;
               $file = $path.'/'.$file;
               if(is_file($file)) {
                   echo "<tr><td><img src='images/file2.gif' width='16' height='16' alt='file'/> <a href='".$file."'>".$fName."</a></td>"
                            ."<td align='right'>".date ('d-m-Y H:i:s', filemtime($file))."</td>"
                            ."<td align='right'>".filesize($file)." bytes</td></tr>";
               } elseif (is_dir($file)) {
                   print "<tr><td colspan='2'><img src='images/dir2.gif' width='16' height='16' alt='dir'/> <a href='".$_SERVER['PHP_SELF']."?path=$file'>$fName</a></td></tr>";
               }
           }
       }

       closedir($handle);
   }	

}

}



?>

This is the code from my <body> section:

<div id="mainbrowser">
				<div class="caption"></div>
				<div id="icon4">&nbsp;</div>
				<div id="result">
				<table width="100%">
				<?php showContent($path);?>
				</table>
				</div>
				</div>

Im just a beginner :) Thanks in advance!

Recommended Answers

check that you're uploading to the right place. check that the files are actually there through your FTP client.

you don't show your upload script.

Jump to Post

All 2 Replies

Member Avatar

check that you're uploading to the right place. check that the files are actually there through your FTP client.

you don't show your upload script.

Thanks! I didn't know that Directories are case sensitive :) MUCH THANKS! this case is solved!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.