Difficulties using certain urls with Insert From Url

I'm grabbing images for a client from their old database. I have an fmp12 where one field has the image url, the next field is an empty container. I want to insert the image from the URL into the container field.

I'm using Insert from URL with the urls for the images. However it only works sometimes.

This link works fine:
https://jdj-projects.nil-database.com/attachments/get_shared_attachment/149/413108/66660101/c6707a87a3fa53da34d252cdae29de209937e18a/original/?fd=1

This link doesn't work:
https://jdj-projects.nil-database.com/attachments/get_shared_attachment/149/363916/66660101/d5c11e8711bf1f3b9606504fc94dafa699f9eb92/original/?fd=1

I get error 10 "Requested data missing". When I use these links with a browser, I get the exact same behavior with both- it downloads the image. I tried fooling with the ?fd=1 parameter, but no luck.

Any ideas of how I can get this to work?

Thanks

Hello @nihm

Try using the following flag in the cURL options that you set up for the Insert From URL step:

   -L

Reason:

The link that hasn't been working does not directly return an image. Instead, it returns a redirect URL which can be used to fetch the image. A browser will automatically follow the redirect, and so the process of using the original URL to fetch the image just seems to work seamlessly when you load the URL into the browser.

By using the -L option in cURL, you are telling cURL to go ahead and follow the redirect, just like your browser does.

Hope this helps,

-Steve

p.s. The "-L" option is shorthand for "--location". Using "--location" should also work (instead of "-L").

5 Likes

Steve- You've saved my Sunday. Thank you so much!

2 Likes