jwnacnud Posted October 22, 2009 Posted October 22, 2009 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.
jamesducker Posted October 22, 2009 Posted October 22, 2009 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 1
jwnacnud Posted November 13, 2009 Author Posted November 13, 2009 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?
jwnacnud Posted June 2, 2010 Author Posted June 2, 2010 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?
Recommended Posts
This topic is 5649 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now