plugins -> make download

sx00199

Verified User
Joined
Nov 16, 2004
Messages
17
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?
 

OxnardMontalvo

Verified User
Joined
Dec 13, 2004
Messages
119
Location
Nashville, TN
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.

=C=
 

sx00199

Verified User
Joined
Nov 16, 2004
Messages
17
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
 

jmstacey

Verified User
Joined
Feb 12, 2004
Messages
4,107
Location
Colorado
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.
 

1024solutions

Verified User
Joined
Jul 19, 2004
Messages
15
tried that...There is still some output from the skin, so the pdf is corrupt.

Any other idea's?
 

DataNumen

New member
Joined
Dec 25, 2006
Messages
1
1024solutions said:
tried that...There is still some output from the skin, so the pdf is corrupt.

Any other idea's?
Hi,

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)
 

hehachris

Verified User
Joined
Nov 24, 2004
Messages
598
Location
Hong Kong
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.

Eg.
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
Code:
<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.
 
Top