Function overview
Prototype
SaveTemp (
_filename )
Parameters
_filename the filename with extension included
Description
Tags:
temp fmtempfm file
FileMaker 9 added the possibility to save in a temporary folder, however this temporary folder is never emptied. In order to delete a file from the temporary folder, the filename should start with the following string: "FMTEMPFM".
That is exactly what this customfunction does, so you don't need to bother anymore. By using this customfunction for saving temporary files, you can be sure that it will be deleted the next time you startup FileMaker.
Examples
Sample input
SaveTemp ( test.pdf )
Sample output
filemac:/Macintosh HD/Users/.../FMTEMPFM_test.pdf
Function code
/* SaveTemp ( _fileName )
by Andries Heylen, BH&A
v.ß1 - Mar 2009
FileMaker 9 added the possibility to save in a temporary folder, however this temporary folder is never emptied. In order to delete a file from the temporary folder, the filename should start with the following string: "FMTEMPFM".
That is exactly what this customfunction does, so you don't need to bother anymore. By using this customfunction for saving temporary files, you can be sure that it will be deleted the next time you startup your computer.
*/
Case ( Abs ( Get ( SystemPlatform ) ) = 1 ; "filemac:" ; "filewin:") & Get ( TemporaryPath ) & "FMTEMPFM_" & _filename
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/212
Prototype: SaveTemp( _filename )
Function Author: Andries Heylen (http://www.fmfunctions.com/mid/57)
Last updated: 11 March 2009
Version: 2.0
*/
// ===================================
/* SaveTemp ( _fileName )__LITBR__by Andries Heylen, BH&A__LITBR____LITBR__v.ß1 - Mar 2009__LITBR____LITBR__FileMaker 9 added the possibility to save in a temporary folder, however this temporary folder is never emptied. In order to delete a file from the temporary folder, the filename should start with the following string: "FMTEMPFM".__LITBR____LITBR__That is exactly what this customfunction does, so you don't need to bother anymore. By using this customfunction for saving temporary files, you can be sure that it will be deleted the next time you startup your computer.__LITBR____LITBR__*/__LITBR____LITBR__Case ( Abs ( Get ( SystemPlatform ) ) = 1 ; "filemac:" ; "filewin:") & Get ( TemporaryPath ) & "FMTEMPFM_" & _filename__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/212__LITBR____LITBR__ Prototype: SaveTemp( _filename )__LITBR__ Function Author: Andries Heylen (http://www.fmfunctions.com/mid/57)__LITBR__ Last updated: 11 March 2009__LITBR__ Version: 2.0__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.
Comments
11 March 2009
didn't you forget to use the parameter in the function code?
maybe try to append "& _filename" ;-)
11 March 2009
12 March 2009
12 March 2009
I use Mac OSX and none of my files are deleted unless I prefix them with FMTEMPFM. I found this solution here:
http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/
This issue should be solved with FM10
(Edited by Andries Heylen on 12/03/09 )
12 March 2009
27 March 2009
19 March 2010