Hello everybody,
I’m trying to link some files from some servers like Sharepoint to my
application.
my problem is when the link is not good, I’m redirected in a 404 error
page (which is normal :p).
I would like to know how to something like a validation method to
display the button to download if the link is correct and to display a
red button if it’s not.
I tried some different things like :
def remote_file_exist?(url)
res = Net::HTTP.get_response(URI.parse(url)) rescue SocketError
res
end
Without success. Each time some files were considered as unvalide
while they were valid and vice versa.
It maybe comes from my code, that’s why i continue to try other
possibilities.
Any idea or suggestion ?