Read-only FTP client!

Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Forum rules
Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Locked
RichardG867
FTP Access
Posts: 596
Joined: Tue Oct 23, 2007 11:21 pm

Read-only FTP client!

Post by RichardG867 »

Well, I made an read-only FTP client, completely written in PHP. Take your opinnion!

Tested with: Abyss X1 2.5, PHP 5.2.5, Windows XP Professional.
And also: IIS 5.0, PHP 5.2.5, Windows 2000 Professional SP4 - Will not work, listing always fails.

Featuring:
- Completely output-buffered, on-the-fly list population
- Progress bar
- Filesize (blank if not supported by server/entry is a directory)
- Link for download managers

Known problems:
- I can't determine if progress is >10, then the progress bar goes back to 0 when real progress is 10.
- Single-purpose connections, warning with anti-hammers!

Code:
Had problems with BBCode, then a phps is available:
http://www.mephost.com/~richard/betaarc ... aster.phps
Last edited by RichardG867 on Fri Mar 21, 2008 5:10 pm, edited 4 times in total.

lisiuwah
FTP Access
Posts: 63
Joined: Fri Dec 28, 2007 9:27 am

Post by lisiuwah »

Could be better if u allow the user to change the port, since some sites has an own port for FTP downloading...



RichardG867
FTP Access
Posts: 596
Joined: Tue Oct 23, 2007 11:21 pm

Post by RichardG867 »

The script is designed to hold one host/port/login/pass per copy.

If you want to change the FTP port, look at $port.

Daniel
User avatar
Posts: 2607
Joined: Wed Apr 11, 2007 2:11 pm
Location: Germany, Earth
Contact:

Post by Daniel »

very nice, thanks for this

Daniel
User avatar
Posts: 2607
Joined: Wed Apr 11, 2007 2:11 pm
Location: Germany, Earth
Contact:

Post by Daniel »

I cant open directories and the link does not wor for me

RichardG867
FTP Access
Posts: 596
Joined: Tue Oct 23, 2007 11:21 pm

Post by RichardG867 »

More details, please.

The .phps link is working properly here.

Andy
User avatar
Administrator
Posts: 12623
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

Post by Andy »

The link works for me just fine.

RichardG867
FTP Access
Posts: 596
Joined: Tue Oct 23, 2007 11:21 pm

Post by RichardG867 »

Well, I tried to use CODE, but the code gets screwed up:

Code: Select all

</title> $file) {
$size = ftp_size($conn,$goto."/".$file);
if ($size = "-1") {
$size = "";
} else {
$size = $size." bytes";
}
echo "<tr><td><a>".$file."</a></td><td>".$size."</td><td><a>Link</a></td></tr>";
$perc = ($num / count($files)) * 100;
$split = @str_split($perc,strlen($perc) - 12);
$perc = str_replace(".","",$split[0]);
echo "<script>document.getElementById('progress').width='".$perc."%';</script>";
ob_flush();
}
echo "</table><script>document.getElementById('progress').width='100%';</script></body></html>";
ob_end_flush();
?>

Daniel
User avatar
Posts: 2607
Joined: Wed Apr 11, 2007 2:11 pm
Location: Germany, Earth
Contact:

Post by Daniel »

Well, on the / directory everything works fine, but when I navigate to a subdirectory, for example /httpdocs, and then click on a file I get:
Directory listing error. Are you trying to list a file?
and when I click on link, I get a 550 error, No such file or dir.

Daniel
User avatar
Posts: 2607
Joined: Wed Apr 11, 2007 2:11 pm
Location: Germany, Earth
Contact:

Post by Daniel »

It seems that the script duplicates a part of the URL, when I am in /URLA and try to open the folder URLB (/URLA/URLB) the script tries to open /URLA/URLA/URLB

RichardG867
FTP Access
Posts: 596
Joined: Tue Oct 23, 2007 11:21 pm

Post by RichardG867 »

What server are you using, and what PHP version and OS?

I got the same quirk with Windows 2000 SP4 Professional + IIS 5.0 + PHP 5.2.5 ISAPI (the duplicate one).

EDIT: WAIT, are you trying to click on a file? This is why "Link" exists.

EDIT: Re-check the PHPS, today's last version. Uses statusbar for progress too, and filesize check is done after listing.

Locked