mail attachment problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wrgill999
Forum Newbie
Posts: 2
Joined: Thu Mar 10, 2005 12:23 pm

mail attachment problem

Post by wrgill999 »

i am using a class i found online for sending a mail attachment. the attachment is just a text file. it works fantastic, IF, i use the entire path to the file as the filename.
for example:

if i use:

$filename="../path/file.txt";
$fd=fopen($filename, "r");

this works fine, but it names the file .._path_file.txt.

what i want to do is this:

$filename="file.txt";
$fd=fopen("../path/".$filename,"r");

this will send the file as file.txt, but it will be a totally empty file.

i have also tried using absolute paths.

is there a solution to this?

thanks.
Post Reply