Howdy and Help

javascript United States
  • 18 years ago

    Hey all, looks like a great site. Anyone know how to check for file existence from within JavaScript? I'm building a Royo gallery for my own use and i'd like to be able to run it from a single script file. All I need is a way to check for the existance of a thumbnail, (yes I did try new file; .exists, dosn't seem to want to work) am I retarded, or is it not possible with JS?. Thanks for reading.

  • 18 years ago

    you can't (at least you're not meant to be able ) check for existence of a file on the local machine using client-side scripting. but you can check for files on the server using JavaScript or VBScript within an ASP, or PHP. are you using javascript within an asp? if so i'll give u the code

  • 18 years ago

    Sure, I'll try anything. Thanks for the attempt, regaurdless of the result.


    Gary aka Silverblood
    [email protected]

  • 18 years ago

    are you checking for the exitense of a file on the server or the client's local machine?

  • 18 years ago

    Sorry 'bout that, what i'm doing is trying to manage a rather large and ever-growing number of images in varied catagories (everything from local news stills to wildlife photos to background textures) via thumbnails of the main images, and what i'd like to do is get the manager running locally then open it up for outside use (BTW, to answer your query, server-side). I would prefer to use JavaScript as I am far more adept at it's use, but I'll not turn down any way of making it work.


    Thanks again,
    Gary

  • 18 years ago

    something like this might work:


    Code:
    <%
    Dim FileSystem
    Set FileSystem = CreateObject("Scripting.FileSystemObject")


      If FileSystem.FileExists("C:\WINDOWS\Notepad.exe") Then
         Response.Write "Notepad is installed on this server."
      Else
         Response.Write "Notepad is not installed on this server."
      End If
    %>



    hope that helps.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“A computer lets you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila” - Mitch Ratcliffe