display the contenst
display the contenst
http://home.comcast.net/~goofy4u273/
is my little corrner of the internet, but when i click on it i get a 404
how can i get it to display the files i have in there like this site does
http://www.gamers.org/pub/idgames2/levels/deathmatch/
me
is my little corrner of the internet, but when i click on it i get a 404
how can i get it to display the files i have in there like this site does
http://www.gamers.org/pub/idgames2/levels/deathmatch/
me
guess i need a new one...
-
Absolut Talent
- Almighty Member
- Posts: 2868
- Joined: Mon Jan 07, 2002 12:30 pm
- Busby
- Golden Member
- Posts: 1890
- Joined: Tue Nov 28, 2000 6:25 pm
- Location: Atlanta Area, GA, USA
- Contact:
Or make sure there is no index.htm file (or any HTM files named main, default, index, etc.) and add a .htaccess file with the following lines:
Then put that file in the root directory.Option Indexes FollowSymLinks
<a href="mailto:busby1218@charter.net">
<img src="http://justinbusby.com:8080/signature.gif" border="0"></a>
<img src="http://justinbusby.com:8080/signature.gif" border="0"></a>
- FlyingPenguin
- Flightless Bird
- Posts: 33162
- Joined: Wed Nov 22, 2000 11:13 am
- Location: Central Florida
- Contact:
Make sure there is no indext.htm, index.html, default.htm or default.html file in the directory.
HOWEVER some web servers, for security reasons, don't show directories even without these files present.
HOWEVER some web servers, for security reasons, don't show directories even without these files present.
---
“The Government of Spain will not applaud those who set the world on fire just because they show up with a bucket.” - Prime Minister of Spain, Pedro Sánchez

“The Government of Spain will not applaud those who set the world on fire just because they show up with a bucket.” - Prime Minister of Spain, Pedro Sánchez

-
Absolut Talent
- Almighty Member
- Posts: 2868
- Joined: Mon Jan 07, 2002 12:30 pm
Originally posted by FlyingPenguin
Make sure there is no indext.htm, index.html, default.htm or default.html file in the directory.
HOWEVER some web servers, for security reasons, don't show directories even without these files present.
and being the security driven force that Comcast is......thats what I was thinking they would do would be disabling it
Thats why I suggested using a asp or php based index page to have it manually list the contents. First thing would be to find out if your webspace supports one or the other. Easiest way would be to create a index.asp or index.php file and upload it. Then visit it on your space and see if it shows correctly
To test asp, open up notepad and type the following
Code: Select all
<% response.write "Asp works on this server" %>Now save it. Make sure when you save, in notepad save as type "all files" and save it as a .asp file (so the filename would be something like "asptest.asp" without the quotes)
After saving, do the same thing again, this time write
Code: Select all
<?php
echo "Php works on this server";
?>Do the same thing when you save it, except save it with a .php extention (so it would be "phptest.php", again without the quotes)
Upload those to your server, and try to view them. If they show up as a blank page with only the words "Asp works on this server" or "Php works on this server", then you know which types the server supports and you can write a file accordingly to show the directory contents
-
Absolut Talent
- Almighty Member
- Posts: 2868
- Joined: Mon Jan 07, 2002 12:30 pm
Did a little bit of writing...if your server can handle ASP based files, then you can use the below code. Just copy it all and paste it in notepad. Save it as a .asp file and upload it.
[php]<html>
<head>
<title></title>
<body>
<%
Dim strPathInfo, strPhysicalPath
strPathInfo = Request.ServerVariables("PATH_INFO")
strPhysicalPath = Server.MapPath(strPathInfo)
Dim objFSO, objFile, objFileItem, objFolder, objFolderContents
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strPhysicalPath)
Set objFolder = objFile.ParentFolder
Set objFolderContents = objFolder.Files
%>
<Table cellpadding=5>
<tr align=center>
<TH align=left>File Name</th>
<th>Type</th>
<th>File Size</th>
<Th>Last Modified</th>
</tr>
<%
For Each objFileItem in objFolderContents
%>
<TR>
<td align=left>
<a href="<%= objFileItem.Name %>">
<%= objFileItem.Name %>
</a>
</td>
<td align=right>
<%= objFileItem.type %>
</td>
<td align=right>
<%= objFileItem.size %>
</td>
<td align=right>
<%= objFileItem.DateLastModified %>
</td>
</tr>
<%
Next
%>
</table>
</body>
</html>[/php]
As for the php.....I am not quite sure as I am still in the process of learning enough of it to get by for now. WHat I write doesnt seem to work as Im getting errors on my while/if lines.....but there doesnt seem to be anything out of place in my code...but its late so I may be overlooking something
[php]<html>
<head>
<title></title>
<body>
<%
Dim strPathInfo, strPhysicalPath
strPathInfo = Request.ServerVariables("PATH_INFO")
strPhysicalPath = Server.MapPath(strPathInfo)
Dim objFSO, objFile, objFileItem, objFolder, objFolderContents
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strPhysicalPath)
Set objFolder = objFile.ParentFolder
Set objFolderContents = objFolder.Files
%>
<Table cellpadding=5>
<tr align=center>
<TH align=left>File Name</th>
<th>Type</th>
<th>File Size</th>
<Th>Last Modified</th>
</tr>
<%
For Each objFileItem in objFolderContents
%>
<TR>
<td align=left>
<a href="<%= objFileItem.Name %>">
<%= objFileItem.Name %>
</a>
</td>
<td align=right>
<%= objFileItem.type %>
</td>
<td align=right>
<%= objFileItem.size %>
</td>
<td align=right>
<%= objFileItem.DateLastModified %>
</td>
</tr>
<%
Next
%>
</table>
</body>
</html>[/php]
As for the php.....I am not quite sure as I am still in the process of learning enough of it to get by for now. WHat I write doesnt seem to work as Im getting errors on my while/if lines.....but there doesnt seem to be anything out of place in my code...but its late so I may be overlooking something
- Busby
- Golden Member
- Posts: 1890
- Joined: Tue Nov 28, 2000 6:25 pm
- Location: Atlanta Area, GA, USA
- Contact:
ASP is so gross and disgusting in my opinion.
The filetype column may or may not work depending upon the configuration of magic_mime. If not, let me know I can remove it. And if you want to see what the output looks like, <a href="http://128.61.49.173:8080/files/test.php">click here</a>.
*EDIT*
Stupid smilies ruining the increment of a variable.
*EDIT AGAIN*
It didn't handle directories very well so I fixed it. Should handle almost anything thrown at it.
Code: Select all
<?php
echo "
<table align='center' width='75%'>
<tr>
<td width='35%'><b>Filename</b></td>
<td width='25%'><b>File Type</b></td>
<td width='30%'><b>Last Modified</b></td>
<td width='10%'><b>Size</b></td>
</tr>
<tr>\n
<td width='35%'> </td>\n
<td width='25%'> </td>\n
<td width='30%'> </td>\n
<td width='10%'> </td>\n
</tr>\n";
$current = ".";
$filelist = array();
$directories = array();
$m = 0;
$j = 0;
if(is_dir($current)) {
if($dh = opendir($current)) {
while(($file = readdir($dh)) !== false) {
if($file == ".") continue;
else if($file == "..") {
echo "
<tr>\n
<td width='35%'><a href='$file'>Parent Directory</a></td>\n
<td width='25%'>--</td>\n
<td width='30%'>--</td>\n
<td width='10%'>--</td>\n
</tr>\n";
}
else if(is_dir($file)) {
$stats = stat($file);
$mtime = $stats[9];
$modified = date("g:i A F j, Y", $mtime);
$dir = "<tr>\n
<td width='35%'><a href='$file'>$file</a></td>\n
<td width='25%'><b>Directory</b></td>\n
<td width='30%'>$modified</td>\n
<td width='10%'>--</td>\n
</tr>\n";
$directories[$j] = $dir;
$j++;
}
else {
$stats = stat($file);
$filetype = mime_content_type($file);
$mtime = $stats[9];
$modified = date("g:i A F j, Y", $mtime);
$size = $stats[7];
$units = array(' B', ' KB', ' MB', ' GB', ' TB');
for ($i = 0; $size > 1024; $i++) {
$size /= 1024;
}
$finalsize = round($size,2);
$filestuff = "
<tr>\n
<td width='35%'><a href='$file'>$file</a></td>\n
<td width='25%'>$filetype</td>\n
<td width='30%'>$modified</td>\n
<td width='10%'>$finalsize $units[$i]</td>\n
</tr>\n";
$filelist[$m] = $filestuff;
$m++;
}
}
closedir($dh);
}
}
for($k = 0; $k < count($directories); $k++) {
echo "$directories[$k]";
}
for($l = 0; $l < count($filelist); $l++) {
echo "$filelist[$l]";
}
echo "
</table>";
?>
*EDIT*
Stupid smilies ruining the increment of a variable.
*EDIT AGAIN*
It didn't handle directories very well so I fixed it. Should handle almost anything thrown at it.
<a href="mailto:busby1218@charter.net">
<img src="http://justinbusby.com:8080/signature.gif" border="0"></a>
<img src="http://justinbusby.com:8080/signature.gif" border="0"></a>
- Busby
- Golden Member
- Posts: 1890
- Joined: Tue Nov 28, 2000 6:25 pm
- Location: Atlanta Area, GA, USA
- Contact:
Oh yeah here is an explanation of a HTACCESS file:
http://httpd.apache.org/docs-2.0/howto/htaccess.html
http://httpd.apache.org/docs-2.0/howto/htaccess.html
<a href="mailto:busby1218@charter.net">
<img src="http://justinbusby.com:8080/signature.gif" border="0"></a>
<img src="http://justinbusby.com:8080/signature.gif" border="0"></a>
- Busby
- Golden Member
- Posts: 1890
- Joined: Tue Nov 28, 2000 6:25 pm
- Location: Atlanta Area, GA, USA
- Contact:
Ok I searched the FAQs and Comcast doesn't support PHP and/or ASP. You have enabled the Personal Web Pages service through the online thing Comcast has right? If so then it is a file that is blocking access. Also, are you using the Online Storage feature or the PWP feature? If you are using [url]ftp://upload.comcast.net[/url] then that is the Online Storage and not the Personal Web Page feature.
<a href="mailto:busby1218@charter.net">
<img src="http://justinbusby.com:8080/signature.gif" border="0"></a>
<img src="http://justinbusby.com:8080/signature.gif" border="0"></a>
-
Absolut Talent
- Almighty Member
- Posts: 2868
- Joined: Mon Jan 07, 2002 12:30 pm