Background:
We have a paid service that we download zip files from. The zip files are in a very predictable format like this
"file_<date>_Level1.zip"
"file_<date>_Level3.zip"
"file_<date>_Level7.zip"
"file_<date>_PG.zip"
The only interface to download there files are from a website that uses adobe flash and you have to traverse a navigation tree 4 levels deep, download a file, then traverse another tree 4 levels deep and download the next file. There are over 100 files and it takes a user about 1.5 days to do this.
Because the file names are very predictable - and have been for years, I am trying to generate a webpage that they can open locally on their laptop and the links point directly to the download, so when they click on the link it automatically downloads the file. something like:
www.contoso.com/resources/downloads/file__<date>_Level1.zip
www.contoso.com/resources/downloads/file__<date>_Level3.zip
www.contoso.com/resources/downloads/file__<date>_PG.zip
Every week, these files are updated and not all of the levels are there, so when I dynamically generate these links, about 25% of them fail.
Question:
I am looking for a way to check if the download link is valid, and if not perhaps gray it out or add an image that is now visible that is like a red x indicating that the file is not there.
What I tried:
I tried using AJAX, jquery, php, all kinds of things, and I mostly ran into what I believe are CORS issues? About cross-domain requests? I have spent probably 2 days on this with tons of trial and error and research. It seems like it would be such a simple thing: "Does the zip file exist at this url?"
Since the webpage with download links is really just a simple html file that they will probably have on their desktop, I also tried disabling CORS with something like chrome --disable-web-security --user-data-dir and other options.
So frustrated, any help is appreciate, also my level of AJAX, jquery, php etc. is basic, my career has been spent in SQL Server, Azure, etc.
Thanks, Matt