Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Check if file (image) exists on web server

Featured Replies

  • Newbies

Hi, I'm hoping someone can help.

I'm building an image library and I need to be able to check (ie set a field to true or false) if an image exists on a remote server over the internet.

eg :P http://www.site.com/folder/subfolder/image.gif

The best solution I've come up with so far is call a shell script that will download the image locally, check if it exists in a specific local location and return yes or no, then delete the local copy.

Is there potentially a one step, cleaner solution?

This is eventually going to be part of a loop trawling through thousands of images, so the cleaner/faster, the better.

I'm using 8.5 Pro on OS X 10.4.7.

There may be a better way, but I see that curl has an -I option (that's a capital i), which returns only the header of the file. It does not download the file.

If file is there, 1st line: "HTTP/1.1 200 OK"

Otherwise 1st line: "HTTP/1.1 404 Not Found"

  • Author
  • Newbies

That's great, I'll experiment with that.

This is the first project I've undertaken with 8.5 and I see there's a web viewer field that may also do exactly what I need if I populate it with the image URL.

Thanks.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.