View Full Version : plugins -> make download

04-09-2005, 03:47 AM
Is there anyway i can produce a download option by plugins?

My plugin makes a pdf document, i want to have this downloaded.

Since i can't use the php header functions, is there any other way to have this accomplished?

04-09-2005, 07:55 AM
Use Javascript document.location to load the file after the PDF is generated? (I've done this on at least one project where header() wouldn't work.


04-11-2005, 05:34 AM
no, i ment inside directadmin. I've written a plugin which show a table with links. the links are generated pdf files.

The files are located inside the plugin dir and therefor not direct accessible.

the javascript function will not work

05-07-2005, 12:31 AM
You might be able to have you php script upon request, send out the proper headers for the download type, and then read the file to the downloader using fopen or a similar method.

05-07-2005, 02:46 AM
tried that...There is still some output from the skin, so the pdf is corrupt.

Any other idea's?

12-25-2006, 05:46 PM
Originally posted by 1024solutions
tried that...There is still some output from the skin, so the pdf is corrupt.

Any other idea's?


You can try our product Advanced PDF Repair. It is a powerful tool to repair corrupt or damaged PDF documents.

Please visit http://www.datanumen.com/apdfr/index.htm for detailed information about Advanced PDF Repair.

And you can also download a free demo version at http://www.datanumen.com/apdfr/apdfr.exe

Alan Chen
DataNumen, Inc. - World leader in data recovery technologies
Website: http://www.datanumen.com
Fax: +1-800-9917-FAX (US Toll-Free), +852-31829286 (HONG KONG)

12-25-2006, 10:58 PM
my 2 cents.
since the header output in DA page does not like what we would have under Apache, we could do some trick to accomplish.

1, place a PHP file "output.php" in /var/www/html
what it does is to output the header() functions...
2, in your plugin, change the link to

<a href="_hostname_/output.php?id=<?=$id?>">DOWNLOAD</a>

remember to change the hostname.

And of course, your output.php should be well protected and should have strict validation.