Skip to main content

How to know if a public_id there

Comments

1 comment

  • Nadav Ofir

    You can issue a HEAD Request, for an example (in Rails):

    require 'rest_client'
    url = cl_image_path(public_id)
    
    begin
      RestClient::Request.execute(:method => "HEAD", :url => url)
      puts "exists!"
    rescue
      puts "doesn't exist!"
    end
    
    0

Post is closed for comments.