External file management problem

Discussion created by fmpros on Oct 8, 2012
Latest reply on Oct 9, 2012 by fmpros

I have B&W graphics in externally stored secure container fields. I want users to click on the container (or an "Edit" button) and have the graphic open in it's native app for editing. Then close, save the file. Then click an "Update" button to update the graphic in the container field. Nothing special, I have had this working for years in an old V6 program using Windows OLE. For the edit I use Export Field Contents, automatically open.... fine. User can edit and save. But if I use Insert Picture (they're jpegs) for the Update I get an error that the file can't be found. Sorry, I export the file to the FileMaker Temp folder with the record UUID as file name and get the extension from parsing GetAsText ( contanier ). If I use Insert File it works fine... updates the container graphic without complaint. If I "re-edit" I get an error re accessing the file (it's still there on disk).


So I moved it out of the FileMaker temp folder to my own temp thinking there may be something inherent in the FMP temp folder. Same problem. It appears that FileMaker has a lock on the file. So I attempted to delete the file after the "update" so a re-edit would create a new file on disk. But that generates an in-use error denying the delete (using a plugin file delete fx). Close FMP and reopen, the graphic file is still on disk, and I can run the delete script and it works fine because FileMaker hasn't touched it yet with export or import.


Anyboby know how I can make this work cleanly so the user just clicks to edit and save and then clicks to update, repeatedly if necessary, without the collision with FMP?