Page 1 of 1

File Download within Module

Posted: Tue Feb 26, 2008 6:30 pm
by jensr
Hey,

its me again, I have a function within my module, which counts and downloads files:

Code: Select all

..

//prepare header
header("Content-type: ".filetype(PATH.$filename));
header("Content-Disposition: attachment; filename=".$filename);
header("Content-Length: ".filesize(PATH.$filename));

readfile(PATH.$filename);
	
exit;

..
This code works fine as standalone, but not within my module.
I have CMS HTML-Code within my downloads.

Can somebody help me?

Kind regards,
Jens

Re: File Download within Module

Posted: Tue Feb 26, 2008 7:38 pm
by alby
jensr wrote: its me again, I have a function within my module, which counts and downloads files:
Why you don't use Uploads module?

Alby

Re: File Download within Module

Posted: Tue Feb 26, 2008 9:57 pm
by jensr
Because I try to include a script and don't want to use another module for this function..