PDA

View Full Version : Check if a file on the web exists



cobracore
06-18-2008, 07:55 PM
Hi guys, my first post =p.

I'm currently trying to write a little thing that basically compares webpages to check if one server got all the uploads the other one did.

Some of these pages will have files available for download - mostly .doc, .pdf and .xls files. The first part, the checking of the webpage, is no problem. I'm using a simple query - if the query works, then that's fine. But I also need to check if the attached files are on the server or not.

At first I thought of using OnError, and if there's no Error then it exists, but then the popup 'This may not be safe OK cancel' Excel warning thing comes up. I don't want to have to click every time - defeats the purpose.

So I need a way to check if a file on the web exists or not (I have the getting hyperlink part down).

I'm using Excel 2003 - If a solution needs add ins or anything, please say so =p.

IF you're going to point out that there are better methods of doing this outside of excel or anything, don't bother. I only actually need to compare 7 pages (not sites, individual pages). I just thought it would be a fun exercise.

Thanks a lot.