5 Replies Latest reply on Jul 7, 2009 1:05 PM by etripoli

    Writing data to a container field from a php application.

    kanalje

      Title

      Writing data to a container field from a php application.

      Your post

      I've been twisting my brain for days now trying to figure this one out. A little background first:

      We used to have a function in our filemaker databse where our users, through a filemaker pro client, could add pictures. The rules where; make a jpg preview and a jpg thumbnail version of each image and insert them in the appropriate container fields. The original image file should only be added as a file reference since they often where quite large (8MB+) and in formats that filemaker couldn't handle (tif, eps). This didn't work as people misunderstood the instructions and inserted large images in the thumbnail fields which put a lot of stress on the database. It also proved to be quite time consuming. This is where I stepped in and said "Hey. This could easily be done with a simple php frontend. I could use Image Magick through php and let it take care of the different converting and resizing operations and then just import the data into the database." ...oh how I wish I hadn't said that.

      It didn't take me long to realize that there is no way of importing images to a container field built into the fm php api (you can stop me at any point from here on out if you want) and so in a state of panic I started looking for options. My first thought was to upload the images to a folder on the server and then use a web viewer field inside filemaker to point to the url of the image. This showed the image but the field type itself provides no formating options and showed an ugly embossed border around the image. This was unacceptable since the image is to be used on printable product imformation sheets. My second thought was to use some sort of plugin and I found that I could use Troi's URL plugin. By having a calculated container field that would take a field containing the image url as input. This tells me that the solution to my problem may be out there but I cannot ask the entire userbase of this database to buy and install this plugin. I was hoping that I could install the plugin server side but running a plugin server side turned out to be a little different from what I thought it would be.

      I should say that I have very little filemaker experience. I have done a lot of php programming on pages displaying filemaker data and I assumed it would be just as easy writing filemaker data. For some weird reason it is not, and that's what got me into this mess. Please tell me there is another way around this problem.