Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6047 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

  • 2 weeks later...
Posted

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.

This topic is 6047 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.