[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] [RAQ4] ProFTP anonymous download location change?
- Subject: Re: [cobalt-users] [RAQ4] ProFTP anonymous download location change?
- From: "Shaun Johnston" <shaun@xxxxxxxxxxxxxxxx>
- Date: Mon Dec 23 15:17:41 2002
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
Hi.
You may be able to use the script below to access the files w/o having to
duplicate them. It will read them from their current directory (once you
specify it in the script).
Shaun.
filelist.html:
----------------------------------------
<html>
<head>
<title>List of Files</title>
</head>
<body>
<a href="http://sub.domain.com/fileget.php?f=file1_name.ext">Get File 1
Here</a><br />
<a href="http://sub.domain.com/fileget.php?f=file2_name.ext">Get File 2
Here</a><br />
</body>
</html>
----------------------------------------
fileget.php:
----------------------------------------
<?php
if (!$_GET['f']) {
echo 'No file parameter given';
exit;
}
$fullpath = '/path/to/repository/' . $_GET['f'];
if (file_exists($fullpath) {
$thefilesize = filesize($fullpath);
$thefile = fopen($fullpath, 'r');
$thefiledata = fread($thefile, $thefilesize);
header('Content-Length: ' . $thefilesize);
header('Content-Disposition: attachment; filename=' . $_GET['f']);
echo $thefiledata;
}
else {
echo 'The file dies not exist!';
exit;
}
?>
----------------------------------------
----- Original Message -----
From: "Thom LaCosta" <baltimoremd@xxxxxxxxxxxxxxx>
To: <cobalt-users@xxxxxxxxxxxxxxx>
Sent: Saturday, December 21, 2002 10:51 AM
Subject: Re: [cobalt-users] [RAQ4] ProFTP anonymous download location
change?
> On Fri, 20 Dec 2002, Greg Hewitt-Long wrote:
>
> > >Doh...why duplicaye them...just do an
> > ><a href = "drakemd6.zip"><b>Download DrakeMD6.ZIP</b></a><br>
> > >or did I misapprehend the question?
> >
> >
> > yes - you sure did. Your method is a protocol-less file reference.
> > Users are emailed these locations after registration - tell me how that
> > would work in an email...
>
> Ah...my error
> >
> > If they are in the anonymous ftp folder, they are referenced as:
> > <a href="ftp://domain.com//pub/filename.ext">FTP Download HERE</A>
> > Are you telling me that
> > <a href="http://domain.com//pub/filename.ext">HTTP Download HERE</A>
> > will also work? I don't think so - the httpd goes to the web folder,
> > and the ftp goes into the ftp folder of the virtual site
>
> It's far too complicated for my appliance operator mind...that's why I use
> the http method (g).
>
> Maybe one of us should try the others suggestion...just to see if it does
> work...since it appears neither one of us knows for sure.
>
> Thom
>
> baltimoremd@xxxxxxxxxxxxxxx Thom LaCosta K3HRN Webmaster
> http://www.baltimoremd.com/ Baltimore's Home Page
> http://www.baltimorehon.com/ Home of the Baltimore Lexicon
> http://www.zerobeat.net Home of The QRP Web Ring and
DrakeList
> http://www.tlchost.net Web Hosting as low as $3.49/month
>
> _____________________________________
> cobalt-users mailing list
> cobalt-users@xxxxxxxxxxxxxxx
> To subscribe/unsubscribe, or to SEARCH THE ARCHIVES, go to:
> http://list.cobalt.com/mailman/listinfo/cobalt-users
>