469,315 Members | 1,643 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

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 7603
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.