0

I am playing always the same video link from a financial web site to my Web site. The only change in the link from day to day is the date of the video. The video for the actual day is not always available at the same time. I have to show the latest video available. My question is what would be the code to look and see if the link for today exists so that I will use today's link or if null I will show only the latest available video.

Omar
  • 16,329
  • 10
  • 48
  • 66
user1714324
  • 281
  • 1
  • 3
  • 5

1 Answers1

0

C#

Better to do it from the server and not the client. Look to see if the file is there with C#. If not give it one that is. File.Exists

JavaScript

This is not as good since it means extra http requests. If the file is on the same domain, make an Ajax call to it. Use a HEAD request. If it gets the file, you know it is there. If it errors, you know it is not there.

epascarello
  • 204,599
  • 20
  • 195
  • 236