473,387 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem using FPDF

Hi,

i've got a problem using PHP FPDF library to create PDF files send
inline to
a browser window.

The created PDF file opens correctly in the browser (IE 6), but if I
want to save
it to my local disk, there is not automatically the filename used I
passed
to the "Output" function of the lib.

Instead the name of the html page is proposed in the file chooser.

Does anyone have an idea how to get the correct filename automatically
in teh file chooser dialog?

Thanks in advance,
Carsten

Nov 7 '07 #1
5 7772

<ca*******@t-online.dewrote in message
news:11**********************@50g2000hsm.googlegro ups.com...
Hi,

i've got a problem using PHP FPDF library to create PDF files send
inline to
a browser window.

The created PDF file opens correctly in the browser (IE 6), but if I
want to save
it to my local disk, there is not automatically the filename used I
passed
to the "Output" function of the lib.

Instead the name of the html page is proposed in the file chooser.

Does anyone have an idea how to get the correct filename automatically
in teh file chooser dialog?
what fpdf version are you using? whatever the case, just look a the output
function and check what headers it's sending out. check to make sure there
is header line for:

header('content-disposition: attachment; filename="' . $name . '"');

and that $name (or whatever variable name is used for the file name param)
is set...you also need to make sure you are passing 'D' as the $dest
(destination) param.

hth,

me
Nov 7 '07 #2
Hi,

i'm using fpdf version 1.53, but passing an "I" for "inline" as
destination, because I want the browser to open the pdf directly using
the browser plugin. If I use "D", there appears a dialog asking me to
save or to open the file. But thst's not what I want to have...

The header is set corectly for "D" as you wrote, and for "I" it is

header('Content-disposition: attachment; filename="'.$name.'"');

Any further idea?

Thanks,
Carsten
Nov 7 '07 #3
Hi,

i'm using fpdf version 1.53, but passing an "I" for "inline" as
destination, because I want the browser to open the pdf directly
using
the browser plugin. If I use "D", there appears a dialog asking me to
save or to open the file. But thst's not what I want to have...
The header is set corectly for "D" as you wrote, and for "I" it is
header('Content-disposition: inline; filename="'.$name.'"');
Any further idea?
Thanks,
Carsten

Nov 7 '07 #4

"Tompkins" <ca*******@t-online.dewrote in message
news:11**********************@d55g2000hsg.googlegr oups.com...
Hi,

i'm using fpdf version 1.53, but passing an "I" for "inline" as
destination, because I want the browser to open the pdf directly using
the browser plugin. If I use "D", there appears a dialog asking me to
save or to open the file. But thst's not what I want to have...

The header is set corectly for "D" as you wrote, and for "I" it is

header('Content-disposition: attachment; filename="'.$name.'"');

Any further idea?
well, for starters, don't switch thoughts mid-stream!

"but if I want to save it to my local disk, there is not automatically the
filename used I passed"

and then:

"because I want the browser to open the pdf directly using the browser
plugin."

stick with telling us EXACTLY what you are having problems with, and maybe
we can help you.
Nov 7 '07 #5

"Steve" <no****@example.comwrote in message
news:XS***********@newsfe05.lga...
>
"Tompkins" <ca*******@t-online.dewrote in message
news:11**********************@d55g2000hsg.googlegr oups.com...
ok, i re-read your hodge-podge op. what you're saying is that:

=====

i want to display a pdf directly in the browser, and when i use the
*browser's* file->"save as" menu option, the browser gives the default file
name as the name of the url/web-page rather than the file name i specified
in the header.

=====

if that is the case, there is nothing you can do to be consistent across all
browsers. headers are "directives", not "commands". the browser treats them
like *suggestions* and nothing more. this has nothing to do with fpdf.

to test it, put an already created pdf in your web root, use a browser to
pull it up via its url...then file->'save as'. notice, url...not file name.
Nov 7 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: André Gasser | last post by:
hello newsgroup, I just discovered a weird effect in my php code. here is the flow of my code: 1. upload jepg file to server 2. create new (empty) jpeg file using imagecreatefromjpeg()...
4
by: bmiras | last post by:
I've got a problem using urllib2 to get a web page. I'm going through a proxy using user/password authentification and i'm trying to get a page asking for a HTTP authentification. And I'm using...
4
by: Derek Timothy | last post by:
Hi folks I have strange problem using cmd.exe from asp code I am trying to save the results of an FTP command into a text file. When I run this command from the command line of the web server it...
3
by: Jacky Zhu | last post by:
Hi all, I am having a problem trying to consume a webservice that is developed on ..Net. I can access it without any problem using a .net client, but when I use a java client (based on Axis...
4
by: Dani | last post by:
Hi everyone Description of the problem: Using a PreparedStatement to write down an integer (int) plus a timestamp for testing purposes. When read out again the integer looks very different. We...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
1
by: sck10 | last post by:
Hello, I am pulling data from a SQL Server table. One field that is (varchar 4000) is used to show notes. I am using a FormView for showing and editing the data. When the form is in Item...
3
by: Franky | last post by:
Been having a problem using a treeview. Work great the first time the form containing it is entered but not the second time. Took a while to create a small sample that exhibits the problem, but...
3
by: presencia | last post by:
Hi all, I have a problem using gdb. I am using Eclipse-CDT as a frontend, but since this problem is obviously related to the gcc compiler or the gdb itself, I have reproduced it without Eclipse. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.