Jump to content

Getting an image from a Web Viewer to External Container Storage

Recommended Posts

This is kind of a unique situation.

When working with Open Library: You can call for Cover images by creating a URL with the ISBN.. and if the Cover is available, it will show up.


"http://covers.openlibrary.org/b/isbn/" & ISBN::ISBN_Search  & "-L.jpg" will give you the image in a web viewer.  Literally, the image only, which is actually a different URL that is not really able to be created via calculation. Otherwise a simple Insert From URL would work.

If I drag that image to a container.. I predictably get the actual URL of the image.

I want to get that image from the Web Viewer into a Container field with -external- storage.  So I can't paste it, or set field..  :)




Link to post
Share on other sites
2 hours ago, Tony Diaz said:

I want to get that image from the Web Viewer into a Container field with -external- storage.  So I can't paste it, or set field..  :)

Why not? 

BTW, I believe you could script the process of getting the image - or rather the URL of the image, by setting your web viewer to the initial URL and pausing for a while before getting GetLayoutObjectAttribute ( "webviewer" ; "source" ). But I don't see how the storage method affects the methods you can use to populate the field.


Link to post
Share on other sites
2 hours ago, MonkeybreadSoftware said:

Do you use MBS FileMaker Plugin?

I should have known. Swiss Army Knife for FileMaker.

Yes, as soon as I can get some extra cash .. this COVID mess has things all the heck over the place. I've been trying to -not- get too reliant on MBS ... yet. 😉


4 minutes ago, comment said:

But I don't see how the storage method affects the methods you can use to populate the field.

That's kind of just it. I've not been successful with extracting that filename from the webviewer instance.

Given that there's nothing else there.. and even if I capture that URL, I'm not sure it would work because hard coding


and use that with Insert URL it doesn't work at all. But .. I just tried it without the trailing text past the type .ext and I'm back to getting the unable to "Can not write file to the external storage ... which is where I'm ending up no matter what route I take.

I can get it into an internally stored container, but not an external one. Which I kinda of get, as the external container is based around having a filename / INODE to handle.. and the internal container is a blob of data.

So, save it some place with a predictable filename, then insert from file to the container.

Set Field [ ISBN::ISBN_Cover ; ISBN::ISBN_Cover Holding ] 
Set Variable [ $TempFILE ; Value: "File.jpg" ] 
Export Field Contents [ ISBN::ISBN_Image_L ; “$TempFILE” ; Create folders: Off ] 
Insert File [ “$TempFILE” ] 

Something hack like this .. and I -still- get cannot write to external storage.

MBS... Hmmmm...

Using MBS, I get the impression that with either of those functions I'm going to get a 1:1 pixel image of what is in the web viewer. Including the white space. I want the actual asset.

Link to post
Share on other sites

Yes, that does. Now to see what you've got going on there.. :)

The desired end result is to take the largest of what is offered and stick it in my container field, or mine if I need to shoot one with the USB camera ... (MBS Plug In) or Insert From Device for the iPad.

Thanks for the boost in the right direction. :)

Link to post
Share on other sites


.. That's interesting, though. At the end of it all:

Set Variable [ $redirectURL ; Value: GetLayoutObjectAttribute ( "OpenLiibraryLargeImg" ; "source" ) ] 
Insert from URL [ Select ; With dialog: On ; Target: ISBN::ISBN_Cover ; $redirectURL ] 

...and along the lines it seems like I did that exact thing, though I was getting the URL with ''&ext=' appended to it.

// Set Variable [ $ISBN_Image_L1 ; Value: Left ( $ISBN_Image_L ; -4 ) ]  

.... my sorry attempt at brute force figuring out the syntax to drop the extra characters.

Now back to trying to figure out how to get the book title out of that JSON data. Since they don't seem to have a unique identifier for it. (There's several uses of "title: \"" in there)

Thanks! :)

Link to post
Share on other sites

I saw that. :) I'm not hitting them up for very many at all.  I'm not doing anything more than I would by using their search box as a passive user. If this were a solution being done for distribution or deployment in a working environment..

Otherwise, what I'm looking for on there I'd hardly even begin to call anywhere near a smidgen of 'bulk'. I'll probably end up providing more than not overall. 

Link to post
Share on other sites
  • 1 month later...
On 5/25/2020 at 3:54 AM, comment said:

Does the attached test work for you?

InsertFromRedirectURL.fmp12 164 kB · 9 downloads

On this, you're getting the image into a web viewer first, then inserting from that URL, to the container.

It works, as little as 1 second delay is fine, too- hasn't failed in any testing. Though yes, I realize it may need more .. so for testing the 5 second pause is what I fall back onto just to make sure.

With some slight changes, it's still good: (I have the direct URL already stored in a field).



So taking that same thing and using it here to get the screenshot and thumbnail image. (Yes, I could probably just have FileMaker create that thumbnail too I suppose)



For some reason, I have to do this twice to get it to work. The first time it runs, I'll get this:


 You can see the images are in the web viewer elements, the second container field is selected and thats all I get...
(If I right-click in the web viewer, to move it back to no image showing, then itl won't do it on this next run. )

So if I run it again it will work the second time. As long as those web viewers show the image loaded like it is above.




The end result is, I'd like to have it get those images that the URLs came from in the data below..  why there needs to be the web viewer in the flow doesn't make sense, but whatever, fine. But it's not consistent either.

Seems like I could probably save the file to the local disk via cURL and then insert the file into the container.. but then that's twice the disk access. Shouldn't it just be able to get the image from the URL .. and actually put that into the container, not putting an icon or URL into the container instead?


Set Variable [ $screenshots ; Value: JSONGetElement ( Items::JSON_Blob_Detail ; "screenshots" ) ] 
If [ not IsEmpty( $screenshots ) ] 
	Set Field [ Items::JSON_VariableView0 ; $screenshots ] 
	Set Variable [ $PLATFORM_ID ; Value: "5" ] 
	Set Variable [ $MOBY_ID ; Value: Items::Moby_ID ] 
	Set Variable [ $n ; Value: ValueCount ( JSONListKeys ( $screenshots ; "" ) ) ] 
	Freeze Window

	Go to Layout [ “Moby_Screenshots_Meta” (Moby_Screenshots_Meta) ; Animation: None ]
	Set Variable [ $existingCaptions ; Value: ExecuteSQL ( "SELECT Caption FROM Moby_Screenshots_Meta" ; "" ; ""  ) ] 
		Set Variable [ $i ; Value: $i + 1 ] 
		Exit Loop If [ $i > $n ] 
		Set Variable [ $record ; Value: JSONGetElement ( $screenshots ; $i - 1) ] 
		Set Variable [ $caption ; Value: JSONGetElement ( $record ; "caption") ] 
		If [ IsEmpty ( FilterValues ( $caption ; $existingCaptions ) ) ] 
			New Record/Request
			Set Field [ Moby_Screenshots_Meta::Platform_ID ; $PLATFORM_ID ] 
			Set Field [ Moby_Screenshots_Meta::Moby_IDfk ; $MOBY_ID ] 
			Set Field [ Moby_Screenshots_Meta::Caption ; JSONGetElement ( $record ; "caption" ) ] 
			Set Field [ Moby_Screenshots_Meta::Image_URL ; JSONGetElement ( $record ; "image" ) ] 
			Set Field [ Moby_Screenshots_Meta::Thumbnail_URL ; JSONGetElement ( $record ; "thumbnail_image" ) ] 
			Set Field [ Moby_Screenshots_Meta::Thumbnail_URL ; JSONGetElement ( $record ; "thumbnail_image" ) ] 

			Set Variable [ $redirectURL ; Value: Moby_Screenshots_Meta::Image_URL ] 
			# Stand in code, figure out how to make it work, then put that here.
			Insert from URL [ Select ; With dialog: Off ; Target: Moby_Screenshots_Meta::Screenshots ; $redirectURL ] 
			Set Variable [ $redirectURL ; Value: Moby_Screenshots_Meta::Thumbnail_URL ] 
			Insert from URL [ Select ; With dialog: Off ; Target: Moby_Screenshots_Meta::Thumbnails ; $redirectURL ] 

		End If
	End Loop
	Go to Layout [ original layout ; Animation: None ]
End If


Link to post
Share on other sites

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
  • Similar Content

    • By Spidey
      I have two table: Invoice and Customer.  I like to have the total of all the invoice for a customer between certain date in the Customer portal that show all the customers, but I got a error when I try to debug..
      ExecuteSQL("SELECT SUM(I.TotalAmount) FROM Invoice I JOIN Customer C ON I._kf_CustomerID = C.__kp_CustomerID WHERE date(I.InvoiceDate) between date(C.SearchFromDate ) and   date(C.SearchToDate )" ; "" ; "" )
      I have an error and couldn't figure it out.  Thanks...

    • By Todd Dignan
      I have a client that has been using a send email script step  that brings up the outlook email client on the desktop.  This as worked for years no problem.  It has stopped work on 3 of 35 computers within the last two weeks.  I talked with there IT personal and they have assured me that no updates have happened.  The actual error is -
      Microsoft Office Outlook
      Either there is no default mail client or the current mail client cannot
      fulfill the messaging request.  Please run Microsoft Outlook and set it as
      the default mail client.
      I have double checked with system default  and Outlook's settings.  Both are set to default.
      The client is using the latest version of office 360's and the latest version of FileMaker 18 advance. Both 64bit.
      Any suggestions are welcome.

    • By tbcomputerguy
      I have an excel sheet that controls bills of ladings for a forestry company.  In the example you can see that there is lots going on with this Bill.  It has a payperiod, mill, truck that delivered it, etc.
      I would like setup a database to monitor this.  The fields CT1, CT2, Skid1, Skid2. PROC1, PROC2 are all contractor numbers.  There are 6 contactors.  The percentages in each line are the amount of the volume they performed  In the third line there is a value in CT1 only...they get 100% of the volume.  I can figure out most of this, but am stumped on how I can monitor when a contractor does multiple jobs..ie in line one, contractor 5, cuts and skids.  All 6 contractors could be involved in one BOL. Each one of these jobs, cutting, skidding and processing each has their own respective rate of pay as well.   I think i need a way to break down each line so that I can produce pay summaries for each of the contractors.  I had started this years ago, and thought I asked in a forum, but can't remember where.  Nonetheless, they stopped using multiple contractors per load...Now they have returned, so I am back at it.  So if this is a repost from years ago I apologize.  
      Thanks in Advance

    • By dancer5678
      I am using Filemaker Server 18 on Windows Server 2012 R2
      Been using it for years with no issues
      Currently when I log in to the console it is very sluggish.
      When I get to the Dashboard it shows No databases, then it auto refreshes and the database list appears.
      Within 15 seconds of scrolling the database list to open files the screen refreshes. This situations is happening over and over in a loop.
      Any Thoughts on what is causing this issue?
    • By stevaroni
      I get an error 3 when using a script to Export Records via WebDirect. Using FileMaker Server 18 and have tried both Safari and Chrome both with same results. I have tried using the temporary path, desktop path, and documents path. I have tried using with the automatically open and not. I have tried writing a tab delimited and comma delimited file. Does anyone have ideas I haven't yet tried?

  • Create New...

Important Information

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