Newbies Philip Posted August 7, 2006 Newbies Posted August 7, 2006 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!
Darryl W Posted August 22, 2006 Posted August 22, 2006 I think you might need a plugin for that. I haven't used it but perhaps the troi url plugin would work. Darryl
Fenton Posted August 22, 2006 Posted August 22, 2006 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.
Recommended Posts
This topic is 6736 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