Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
jeby #1
Check to see if a page exists?
Is there a way that I can check to see if a page exists? I was thinking it
might be possible with CFHTTP or something along those lines but am not sure.
I am working on a web app and there is a part where it creates a path base on
a string and I need to be able to verify if the path is valid so that i can
redirect is as appropriate if it is not.
Please Help!!!
Josh
jeby Guest
-
Creating a URL still exists page/util
Hi All Quite familiar with ASP and JavaScript and wondered if there is a method out there that allows me to create a web page util to see if URL... -
check if a recordset exists
in asp is there a way to determine wether a recordset exists or not . the problem is i have On Error Resume Next on my page and if duff data is... -
Check if table exists
ON.KG wrote: One thing to consider: you are making a trip to the database to determine if a table exists. If it exists, you are then making... -
HOW TO: check if a URL exists or not - ErROR 404 ?
My php passes through some links. But I want to redirect if the URL does not exist. How best to check if a URL is there or not? Thanks, gsb -
how to check if a process still exists in a C app
I have the process id. I want to check if it is still running. What is the best (and fastest) way to do this? (for HPUX, AIX, Linux) I can... -
Sir Monkey \(Chris L.\) #2
Re: Check to see if a page exists?
Hi Josh,
CFHTTP will do what you want, just check CFHTTP.errorDetail or
CFHTTP.responseHeader.status_code after the call. BUT, if this is a path to
a file on the local file system, you can also use CFDIRECTORY or CFFILE (if
you know a file that is sure to be in the path). Just some ideas.
HTH and good luck!
--
Best Regards,
Chris
"jeby" <webforumsuser@macromedia.com> wrote in message
news:d9cdp4$evu$1@forums.macromedia.com...> Is there a way that I can check to see if a page exists? I was thinking
> it
> might be possible with CFHTTP or something along those lines but am not
> sure.
>
> I am working on a web app and there is a part where it creates a path base
> on
> a string and I need to be able to verify if the path is valid so that i
> can
> redirect is as appropriate if it is not.
>
> Please Help!!!
>
> Josh
>
Sir Monkey \(Chris L.\) Guest
-
jorgepino #3
Re: Check to see if a page exists?
is that an internal or external page?
jorgepino Guest
-
flasheister #4
Re: Check to see if a page exists?
I'm gonna give this a try, i need to loop through hundreds of URLs automatically...any suggestions on when to timeout and move to the next site or how to error check it?
flasheister Guest
-
jeby #5
Re: Check to see if a page exists?
in response to chris....
So, If i do CFHTTP and get no error then it exists?
in respons to jorgepino...
It is an internal page. I am writing an application that creates a file path
from a string that is passed in the URL. I want to be able to forward the page
to a default path if the page the string points to does not exist...
I dont know if this will be of any extra help to anyone.
My other idea is so possibly catch the error with a <CFTRY> and a <CFCATCH>
but I do not know how to use that tag and have been fairly unsuccessful with it
in the past. If someone could tell me if it would work and how to do it i
would appreciate it.
Thanks everyone! All suggestions are helpful!
josh
jeby Guest
-
mpwoodward *TMM* #6
Re: Check to see if a page exists?
On 2005-06-22 19:47:34 -0500, "jeby" <webforumsuser@macromedia.com> said:
If these are all local pages and I understand what you're getting at,> in response to chris....
>
> So, If i do CFHTTP and get no error then it exists?
>
> in respons to jorgepino...
>
> It is an internal page. I am writing an application that creates a
> file path from a string that is passed in the URL. I want to be able
> to forward the page to a default path if the page the string points to
> does not exist...
>
> I dont know if this will be of any extra help to anyone.
>
> My other idea is so possibly catch the error with a <CFTRY> and a
> <CFCATCH> but I do not know how to use that tag and have been fairly
> unsuccessful with it in the past. If someone could tell me if it would
> work and how to do it i would appreciate it.
> Thanks everyone! All suggestions are helpful!
>
> josh
you could use FileExists() to check for the existence of the file.
Matt
--
Matt Woodward
[email]mpwoodward@gmail.com[/email]
Team Macromedia - ColdFusion
mpwoodward *TMM* Guest
-
A3gis #7
Re: Check to see if a page exists?
quickest way for an internal file is :
<cfdirectory action="list" filter="#fileName#" directory="#filePath#"
name="checkFile">
<cfif checkFile.recordcount neq 0>
FileExists
<cfelse>
No File, YOU LOSE!
</cfif>
cheers,
Aegis
A3gis Guest
-
jorgepino #8
Re: Check to see if a page exists?
FileExists(ExpandPath(yourfile)) Boolean yes or no
<cfif FileExists(ExpandPath(yourfile))>
<p>Your file exists in this directory. You entered
the correct file name, #GetFileFromPath("#thisPath#/#yourfile#")#
<cfelse>
file not found
</cfif>
jorgepino Guest



Reply With Quote

