[FX.php List] calling scripts from FX help

Peter Bates p.bates at sjcpl.org
Fri Oct 21 08:15:34 MDT 2005


Michael,

I gave up a long time ago to attempt to serve up files on the web  
from a container field since there is too many variations of trying  
to specifly where to automatically download a file to a patrons  
computer.

Since I'm a newbie to FX.php, I have not personally tried this out,  
(yet). I'm guessing that this should work under php. I have been  
using xslt for my custom web publishing and here is the way I serve  
up files to my users:

I don't use a container field, instead I use a calculation field and  
a text field in the database and I have a folder, or nested folders,  
located on the web server for file storage. The way it works is  
anything I want my patrons to be able to download, I store it in this  
folder. I then enter the exact name of the file in the text field.  
The calculation field builds the complete path to the file. In the  
filemaker database:

FileName (text field)
FilePath (calculation field)   If ( IsEmpty ( FileName ) ; "" ; "/ 
FolderName/" & FileName )


Then the xslt  basically serves it up as a href with a conditional  
test that only shows a link if the FilePath field is not empty. Here  
is the xslt code that works for me:

<xsl:for-each select="fmrs:resultset/fmrs:record/fmrs:field 
[@name='FilePath']/fmrs:data">
     <xsl:if test="position() != 0"/>
     <a>
           <xsl:attribute name="href">
                <xsl:value-of disable-output-escaping="yes"  
select="fmxslt:break_encode(.)"/>
           </xsl:attribute>
                        <xsl:comment> With the following if statement in
                        place the URL title will only display only if
                        the URL field is not empty </xsl:comment>
           <xsl:if test="fmxslt:break_encode(.)!=''"> Click here to  
download the file</xsl:if>
     </a>
           <xsl:if test=". = ''">
                 <xsl:text disable-output-escaping="yes">&amp;nbsp;</ 
xsl:text>
     </xsl:if>
</xsl:for-each>

If you want to see how this works, goto:  http://fmcwp.sjcpl.org/fmi/ 
xsl/1875Atlas/home.xsl

If you want to try this out. This is the xslt version. I'm currently  
rewriting it for FX.php.


Peter Bates
Microcomputer Network Specialist
Automated Services
St. Joseph County Public Library
304 S. Main St.
South Bend, IN  46601
voice: (574) 282-4610
fax: (574) 282-4662
e-mail: p.bates at sjcpl.org
www:  http:/www.libraryforlife.org
library catalog:
http://www.libraryforlife.org/onlinecatalog/onlinecatalog.html



On Oct 21, 2005, at 7:17 AM, Michael Layne wrote:

> Greg,
>
> Thanks... I had a feeling that was the case.  It's pretty  
> important, so I'd probably be interested in seeing a workaround  
> (even an ugly one).
>
> The example was just a text file, but the requirement is for  
> anything (mostly .doc, .xls, .pdf).  On the client side, there's a  
> custom plug-in that kicks off the launch of the selected document,  
> and supposedly it works through IWP, which is what we're trying to  
> avoid due to the access limits (100 concurrent users).
>
> If you think it's possible to write a small plug-in to allow the  
> script to be called from FMSA, I have a resource I can tap.   
> Otherwise, ugly sounds good.
>
> Thanks very much,
>
> Michael
>
> On Oct 21, 2005, at 1:17 AM, Greg Lane wrote:
>
>> I don't believe it is possible to execute any of the non-web  
>> compatible script steps (which includes Export Field Contents)  
>> through FMSA. There are some ugly workarounds, like using some  
>> sort of triggering mechanism to fire off a script on an FMP client  
>> machine.
>>
>> Is there any possibility of also putting the contents of the  
>> container field's text files into a text field during the import/ 
>> insert process? PHP can read the contents of a text field and  
>> write it to a file.
>>
>> Greg
>>
>> On Oct 20, 2005, at 11:34 PM, Michael Layne wrote:
>>
>>
>>> Well, I've been doing this quite a while, and for some reason, I  
>>> cannot make a script happen...
>>>
>>> ...
>>>
>>
>>
>>> I think it's the script itself...
>>>
>>> Go to Layout [...]
>>> Export Field Contents[...]
>>>
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>
>
> Michael Layne  :  9 degrees development  :  www.9degrees.com  :   
> 404.226.7835
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20051021/c0dd8102/attachment.html


More information about the FX.php_List mailing list