473,396 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

testing for existence of file

Is it possible to check for existence of a file from a web page using
javascript? I am trying to come up with a routine that i can call from the
rest of my javascript code that will check if a particular file exists on
disk at the server. ie bool FileExists("http://myServer.com/File.gif");
Any ideas on how to do this?
Thanks
Eric
May 16 '06 #1
4 1902
Eric said the following on 5/16/2006 6:18 PM:
Is it possible to check for existence of a file from a web page using
javascript?
Is it possible that you didn't search the archives before asking?

<URL:
http://groups.google.com/group/comp....+server&qt_g=1
Search phrase: verify file on server
I am trying to come up with a routine that i can call from the
rest of my javascript code that will check if a particular file exists on
disk at the server. ie bool FileExists("http://myServer.com/File.gif");
Any ideas on how to do this?


See above.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 16 '06 #2
Randy Webb wrote:
Eric said the following on 5/16/2006 6:18 PM:
Is it possible to check for existence of a file from a web page using
javascript?


Is it possible that you didn't search the archives before asking?

<URL:

http://groups.google.com/group/comp....+server&qt_g=1
>


Search phrase: verify file on server
I am trying to come up with a routine that i can call from the
rest of my javascript code that will check if a particular file exists on
disk at the server. ie bool FileExists("http://myServer.com/File.gif");
Any ideas on how to do this?


See above.


Let me ask you, have you looked at the results of that? I doubt it.
I'd urge you to can the attitude, its becoming way too prevalent on usenet
and serves no purpose. If you find my question offensive, dont respond -
simple aint it.
May 16 '06 #3
Eric said the following on 5/16/2006 7:21 PM:

<snip>
Let me ask you, have you looked at the results of that? I doubt it.
You guessed wrong. Although a better phrase to search on would be
"verify file exists" which leads to this thread:

<URL:
http://groups.google.com/group/comp....eb36618d15eece I'd urge you to can the attitude, its becoming way too prevalent on usenet
and serves no purpose. If you find my question offensive, dont respond -
simple aint it.


Get over yourself. This is Usenet, not your help desk. You ask a
question, it gets discussed. You get an answer - Great. You don't, you
get over it and move on.

But, view the above thread.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 17 '06 #4
Eric wrote:
Randy Webb wrote:
Eric said the following on 5/16/2006 6:18 PM:
Is it possible to check for existence of a file from a web page using
javascript?
Is it possible that you didn't search the archives before asking?

<URL:

http://groups.google.com/group/comp....+server&qt_g=1
>


Search phrase: verify file on server
I am trying to come up with a routine that i can call from the
rest of my javascript code that will check if a particular file exists
on disk at the server. ie bool
FileExists("http://myServer.com/File.gif"); Any ideas on how to do this?


See above.


Let me ask you, have you looked at the results of that? I doubt it.


Doubt as much as you want, I do get 87 hits where many are useful to solve
that problem. It is just that you did not care to investigate, or are
unable to comprehend what was posted due to a lack of minimum clue (which
can be fixed by minimum research, though).
I'd urge you to can the attitude, its becoming way too prevalent on usenet
and serves no purpose. If you find my question offensive, dont respond -
simple aint it.


Why is it that the attitude persists that one may post any junk because
nobody has to read it? Everybody pays for the bandwidth you are wasting
with this, one way or another.

That comment usually serves the good purpose of wasting not _more_ time on
individuals with an antisocial attitude. People who violate the standards
that created this very medium, by forging headers in order to avoid spam,
burdening the problems caused by their incompetence and laziness on others.
People who post FAQs again and again, who do not search the archives first.
People who lack the simple courtesy of posting with at least their full
real name, Eric #47110815. It should teach you (and others with the same
attitude) how to get better responses in the future by changing _your_
attitude, instead of simply ignoring you (and thereby not helping you at
all).

This also supports the need of having more time for more interesting people
with more interesting questions, let alone for one's own projects. It can
be argued that such a comment now and then supports this purpose even more
than just ignoring floods of inappropriate postings coming in here.

This is Usenet, not a support forum where you get to read what you want to
read. If you can't stand the heat, get out of the kitchen -- deal with it
or go away. There is a good Usenet tutorial in the KNode online help, BTW.
F'up2 PointedEars
--
Bill Gates isn't the devil -- Satan made sure hell
_worked_ before he opened it to the damned ...
May 22 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Matt | last post by:
Hello, I see other references in this newsgroup saying that the only standard C++ way to test for file existence is some variant of my code below; can someone please confirm...or offer...
2
by: mike | last post by:
I had a form like below that validated that a file was there before it would submit. <form name="attach" method="POST" action="run_this_pgm.cfm" enctype="multipart/form-data"...
3
by: Jim Hunter | last post by:
From what I've read, the only indication fprintf gives of an error is a negative return value. I have a series of writes to a file using fprintf, and, while I need to know if a failure has...
6
by: Lance | last post by:
Hi, How do you test for an object existing in C#? C# seems to differentiate between 'null' and non-existance. In other languages I could test as so: if(ex.InnerException.StackTrace != null)...
12
by: DC Gringo | last post by:
How do I test for existence of a file in the file system: If FileExists(myVariable & ".pdf") = True pnlMyPanel.Visible = True End If -- _____ DC G
7
by: Will McDonald | last post by:
Hi all. I'm writing a little script that operates on either stdin or a file specified on the command line when run. I'm trying to handle the situation where the script's run without any input...
2
by: www.MessageMazes.com | last post by:
Greetings, I'm experimenting with an ASP page that reads data from a file name that is passed to it as a parameter, as in this page, which works, because the "good" file exists. ...
3
by: trint | last post by:
How can I do this with my c# code with my website(because the file is there, but the code doesn't return it)?: if(File.Exists(String.Format("~/images/categories/{0}", sFileName)) return...
6
by: Strato | last post by:
Hi folks, I want to write some kind of test to check at startup if another instance of my script is already running. I don't want to handle writing of a PID file because it is too Unix/Linux...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.