472,141 Members | 1,581 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

Verify URL/file exists

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

May 18 '06 #1
3 7820
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 18 '06 #2
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.

May 18 '06 #3
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.

<URL: http://www.safalra.com/special/googlegroupsreply/ >
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?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Geiregat Jonas | last post: by
18 posts views Thread by Dan | last post: by
2 posts views Thread by MrMike | last post: by
4 posts views Thread by DEWright_CA | last post: by
2 posts views Thread by iwdu15 | last post: by
4 posts views Thread by bryanp10 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.