Jump to content

Storing JPEG from given URL to container field


This topic is 7465 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Wait! One more thing!

Sometimes the URL doesn't lead directy to a JPEG, for example

http://panpic2.feratel.at/panpic2/index.jsp?design=panpic&ID=5590&weatherData=off&stream=on&adv=off&camdata=off

---

Btw: what I'm trying to do is a solution that collects pictures from webcams over the internet, several times every day, and stores them in a database.

Thank you

Link to comment
Share on other sites

  • Newbies

In OS X, you can use URL Access Scripting to download the file, as below (in this example it downloads it to your user Documents folder):(

set docFolder to path to documents folder as string

set theFile to docFolder & ":temp file.jpg"

tell application "URL Access Scripting"

activate

set imageURL to http://mySite/myPic.jpg

try

download imageURL to file theFile with progress replacing yes

end try

try

quit

end try

end tell

You can then put a reference to the image file in your container field, as below:

tell application "FileMaker Pro"

set data of cell "Container" of current record of database 1 to file theFile

end tell

A possible problem with the above approach is that it does not put the actual data for the image in the FMP container, just a reference to it; move the original file, and you lose the image. AFAIK, there is no way to store the data in a FMP container using AppleScript without some help. If you want to store the data, you can use the GraphicsImporter OSAX (available for free at http://osaxen.com/graphicsimporter.html or at http://www.azug.gr.jp/~h-abe/freeware/gio/index.en.html), like so (after downloading the file):

set theImage to giconvert file theFile

tell application "FileMaker Pro"

set cell "Container" of current record of database 1 to theImage

end tell

Good luck!

Link to comment
Share on other sites

  • 4 weeks later...

Hi try this

Perform Applescript

( set the image_name to cell "image_url" of current record

set this_URL to (the image_name)

set the destination_file to ((path to desktop as string) & "image.jpg")

tell application "URL Access Scripting"

download this_URL to file destination_file replacing yes

end tell )

Go to field ["image"]

Insert Picture ["image.jpg"]

exit record

Link to comment
Share on other sites

Try turning off "store compatible graphics" in the FMP preferences. If you do, though, images pasted into the container by a PC client won't display on a Macintosh.

Link to comment
Share on other sites

I tried to get from a url for days before I found the Troi URL plugin. I thought I might be able to if I messed around with Windows long enough, but it was so complex that I knew I'd never make it reliable for my end users. There was no way I'd be able to get them to set it up right, and I don't think it was going to run on 95, 98, or ME. So I went with Troi and I'm glad I did. The only problem that I've had is getting it to work in POST mode. But it works fine in GET mode, and that's all I've needed so far.

Dan

Link to comment
Share on other sites

This topic is 7465 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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