Verify URL/file exists

Discussion in 'Javascript' started by akadelski, May 18, 2006.

  1. akadelski

    akadelski Guest

    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
    akadelski, May 18, 2006
    #1
    1. Advertising

  2. akadelski

    Randy Webb Guest

    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/
    Randy Webb, May 18, 2006
    #2
    1. Advertising

  3. akadelski

    akadelski Guest

    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.
    akadelski, May 18, 2006
    #3
  4. akadelski

    Randy Webb Guest

    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/
    Randy Webb, May 19, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TXJNaWtl?=

    Verify File Exists

    =?Utf-8?B?TXJNaWtl?=, Jan 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    5,965
    =?Utf-8?B?TXJNaWtl?=
    Jan 5, 2005
  2. Carlos Albert

    Verify if Session(hashtable) exists

    Carlos Albert, Dec 9, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    6,366
    addup
    Dec 14, 2005
  3. Jonny

    Verify that line exists in a file

    Jonny, Feb 19, 2005, in forum: C Programming
    Replies:
    9
    Views:
    358
    Mark McIntyre
    Feb 20, 2005
  4. Replies:
    4
    Views:
    930
  5. Henry Miranda

    Verify if file exists on network shared HELP

    Henry Miranda, Dec 17, 2003, in forum: ASP .Net Security
    Replies:
    0
    Views:
    103
    Henry Miranda
    Dec 17, 2003
Loading...

Share This Page