February 6, 200421 yr Newbies Is there a way to query FMP from a web form and have it generate an XML file instead of just returning XML data?
February 6, 200421 yr 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.
February 6, 200421 yr 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.
Create an account or sign in to comment