How to know if a public_id there

Comments

1 comment

  • Avatar
    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
    Comment actions Permalink

Please sign in to leave a comment.