Afrite Posted April 17, 2008 Posted April 17, 2008 I've been making a website for the past few days and have recently run into a problem while trying to make files from a container field download with a specific name.ext. I've been using a modified version of the image bridge like I've seen others do that they say has worked. //the path is the standard urlencode(getfield) //typical database connection info here $dl = $fm->getContainerData($_GET('path')); header('Content-type: application/force-download; name="p.pdf"'); header("Content-Disposition: attachment; name="p.pdf"'); echo($dl); What I get is a download that has the name p.pdf but when it finishes downloading it is unable to be opened by anything. I've tried removing the content-disposition and it downloads a file with the same name as my php bridge and if i rename it it opens perfectly fine as a pdf. I'm really lost as to why it's doing what it's doing. If anyone has any input as to where to go from here I'd be very appreciative. Other Info I've seen where filemaker gives 3 options in the path URL: 1 data.jpg 2 data.gif 3 data.con in order to determine what is in the container. mine always come out to jpg.
Afrite Posted April 25, 2008 Author Posted April 25, 2008 I found out was was wrong with the download and why it wouldn't work. A.) I was storing a reference instead of the actual file(read the php doc from filemaker and they say it's a no no). B.) I was storing PDF's as an image for viewing in the database using a filemaker client and that is also unacceptable. So i fixed those 2 problems and I was able to use the modified bridge with Content-Disposition to force a download of a PDF.
Recommended Posts
This topic is 6395 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now