Verify URL/file exists


A

akadelski

I need a way to verify a file exists before I attempt to open it.

Right now we are storing PDFs server-side and I need a way to either 1.
Check if the physical file exists or 2. check if the URL exists.

I'm opening the PDFs with the following: var
Win=open(theLinkURL,"",linkString);

I create theLinkURL dynamically and the file may or may not exist.

Any help would be GREATLY appreciated.
-Amy
 
Ad

Advertisements

R

Randy Webb

akadelski said the following on 5/17/2006 7:58 PM:
I need a way to verify a file exists before I attempt to open it.

Right now we are storing PDFs server-side and I need a way to either 1.
Check if the physical file exists or 2. check if the URL exists.

Post a form to a hidden IFrame that submits to a server side script that
checks the existence of that file. If it exists, return a page with the
script to attempt to open a new window. If it doesn't exist, return a
page with script to modify the parent page to notify the user that the
file doesn't exist.
 
A

akadelski

Do you have any code samples for this?
All my javascript so far is client side. I'm confused at what the
server-side javascript will look like. I'm muddling through it now.
 
Ad

Advertisements

R

Randy Webb

akadelski said the following on 5/18/2006 5:59 PM:
Do you have any code samples for this?

Code samples for what?

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

All my javascript so far is client side. I'm confused at what the
server-side javascript will look like. I'm muddling through it now.

What server side languages does your web hosting service provide? ASP,
PHP, PERL, what?
 

Top