Newbies RIRedinPA Posted February 6, 2004 Newbies Posted February 6, 2004 Is there a way to query FMP from a web form and have it generate an XML file instead of just returning XML data?
Mariano Peterson Posted February 6, 2004 Posted February 6, 2004 If you use a middleware application like PHP, you can submit the request to a PHP script. The PHP script can forward the request to FileMaker and read the resulting XML stream into a variable. Once the XML is stored in a variable, you can create an output page which would actually prompt the user to download and save the output as a file on their computer. Adding the following PHP code would configure the response to do this, and would send the XML contents as a downloadable file. <? header( "Content-Type: application/unknown" ); header( "Content-Disposition: attachment; filename=[color:"silver"]your_filename_tba.xml[/color]"); print ( $your_xml_variable ); ?> If you're not familiar with using PHP and FileMaker, take a look at the FX.php class available at www.iviking.org. This is a free bit of code that makes it easy to communicate with FileMaker from PHP.
Mariano Peterson Posted February 6, 2004 Posted February 6, 2004 BTW, just as a simple example, the following would prompt the user to download a file to their local file system: <? header( "Content-Type: application/unknown" ); header( "Content-Disposition: attachment; filename=test.txt"); print ( "This text will appear in the text file you download" ); ?> I've loaded a copy of this exact code to my PHP enabled website: http://mariano.petersonpages.com/demo/php/downloader.php This should give you an idea as to what the result is like.
Recommended Posts
This topic is 7594 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