Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Storing JPEG from given URL to container field


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

Recommended Posts

Posted

Take a look at the Troi URL plugin. I messed around for a few days trying to get some internet data into a field. Couldn't get it done reliably. I then found the Troi plugin and had it doing what I needed in about 10 minutes.

Dan

  • Newbies
Posted

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!

  • 4 weeks later...
Posted

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

Posted

thanks,

with url access scripting I did the job.

now I'm facing the problem that the stored images are much much bigger (in bytes) than the original jpeg file. Any idea??

Posted

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.

Posted

>Try turning off "store compatible graphics"

it works!

>images pasted into the container by a PC client won't display on a Macintosh.

who uses pcs???

Posted

"who uses pcs??? "

LOL

people who can use more than one button on a mouse! blush.gif

Anyone found a soulution for this other than mr. Troy?

Posted

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

This topic is 7597 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.