October 22, 200916 yr Very simply, I have FMP Server 9 running on dedicated machine. I use our FMP database to store info and images about the products that we sell on our website. I need to be able to import images and pdf files into the database (and be able to view both filetypes) and have those files stored on the server machine in a folder which I will synchronize with our FTP site for use by our website. Is there a simple way to do this? Currently I import images INTO the database (instead of just references) and then export those images to a specific folder when I am ready to upload them to the FTP site.
October 22, 200916 yr I would be inclined to do more or less the same: 1. import the images in to the database as you do now, rather than store on the file system (so you know exactly where they are, nothing else can touch them and you don't have duplicate filename problems... although if you have thousands and thousands of them, you might want to think again) 2. as part of the "upload to website" routine, use a bit of shell scripting to do the FTP copy to the server. In its most basic form, you need three lines of FM script: export field contents (container field) to file:/tempupload.pdf set variable $shellCommand to "curl -T /tempupload.pdf -u username -ppassword --url ftp://www.myserver.com/path/to/save" perform AppleScript "do shell script "" & $shellcommand & """ You may need to do a bit of escaping and would probably need a variable for the FTP destination path. The CURL command is available by default on Mac OS X and allows for one-line FTP uploads and a whole load of other useful things too, have a look at its "man" page for more details. Hope that helps. I've subscribed to this topic so let me know if you need any more help. James
November 13, 200916 yr Author How about on the server. I am running FMP Server 9 on a mac mini. If I am on a windows terminal and I run a script like this, will the server save the image locally, or will I need to logon to the remote share to save the image?
June 2, 201015 yr Author I don't know if you saw my response earlier. How about on the server. I am running FMP Server 9 on a mac mini. If I am on a windows terminal and I run a script like this, will the server save the image locally, or will I need to logon to the remote share to save the image?
Create an account or sign in to comment