DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Check Remote File Exists

11.22.2010
| 3641 views |
  • submit to reddit
        Related to: http://snippets.dzone.com/posts/show/10225


require 'rubygems'
require 'rest-open-uri'

def remote_file_exist?(url)
  open( url , :method => :head).status rescue false
end