Forum Moderators: coopster

Message Too Old, No Replies

using download and file.class.php

file.class.php

         

karleyb

8:35 pm on Jan 30, 2008 (gmt 0)

10+ Year Member



I am trying to use file.class.php to download a .PDF file on the server after a user has filled out a form. The e-mail part is working but not the download. I wasn't sure which was to specify the file name - full path or http. Here is the code.

if(!$mail->Send())
{
echo "Message was not sent <br>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}else{
echo "Your mail was sent.";
//$f = '/hsphere/local/home/elderlaw/example.com/forms/VA'. "&nbsp;" .'Planning Brochure'. "&nbsp;" .'&'. "&nbsp;" .'Registration.pdf';
$f = "http://example.com/forms/VA". "&nbsp;" ."Planning Brochure". "&nbsp;" ."&". "&nbsp;" ."Registration.pdf";
$file = new file($f);
$file->Download();

[edited by: coopster at 8:36 pm (utc) on Jan. 30, 2008]
[edit reason] please use example.com in code [/edit]

cameraman

9:55 pm on Jan 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, karleyb!

Not being familiar with file.class.php, I did a search on it. I didn't dive terribly deep, but I found this:
"This package is meant to manipulate and handle files uploaded via HTML forms."

Are you sure the class you're using can be used to send files from server to a browser?