Jump to content

I want a web image stored locally


Philip
 Share

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

Recommended Posts

  • Newbies

Hello, I have been playing a bit with the webviewer. I am http request to amazon.com to get a picture of a book.

http://images.amazon.com/images/P/0595345565.01.MZZZZZZZ




The book shows up perfecly in the browser.  I want to then store the pic locally.  I tried naming the web viewer as a layout object and then using 




GetLayoutObjectAttribute (objectName;attributeName)

to set a container field. However, it only worked with "source" as the second parameter and returned a text string web address. Instead I'd like image stored locally... I tried using "content" as the second parameter but it didn't seem to work.

I can drag the image from the web viewer into the container field as a work-around but cannot seem to script that...

Any insights are much appreciated. Thank you!

Link to comment
Share on other sites

  • 2 weeks later...

Personally I don't think the Web Viewer is a very good tool if you only want to extract a piece of data from a web "page." It is mostly a "view the page" or "view the picture" or "view the file" tool; specifically you cannot set a container field to an 'http" file path.

If you're wanting data from Amazon, they have a free web service which allows you to submit a URL request (a few different types of searches and results) and get an xml return. This would be in a FileMaker Import XML step (or curl, read on). This includes the paths to the images; which you could either parse somehow or extract with an xsl stylesheet. The xsl would allow you to import your image path directly to a FileMaker field. But, still you have only an http path to the image.

There are free command-line tools available for each platform, which allow you to get the raw source of a web page, or download a file; such as curl, which is available for each platform; there is also wget, which I've read some use on Windows (Stephen Knight of http://www.fmwebschool.com has written about this, somewhere). Perhaps you can use I.E. on PCs for this, I don't know.

I mostly know Mac, so I'd use curl, within a FileMaker Perform AppleScript step. If you have the http path, curl can write the image to a file, which you can then Insert with FileMaker. (You can write the file to a "temporary" folder if you don't need it outside FileMaker). This sounds like a lot of steps, but it is very fast.

So there's ways to script it without a plug-in, but then it would need to be written a little different for each platform.

Link to comment
Share on other sites

This topic is 5587 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
 Share

×
×
  • Create New...

Important Information

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