Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Image storage and syncing with FTP site

Featured Replies

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.

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

  • 3 weeks later...
  • 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?

  • 6 months later...
  • 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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.