on 12/29/00 10:03 PM, [EMAIL PROTECTED] at
[EMAIL PROTECTED] wrote:
>> I tried:
>> exists (URL "http://www.gurudeva.org/index.html")
>> but it doesn't work even if the file is on the web site.
>> ??Did I do something wrong?
> Try:
> if url "http://www.gurudeva.org/index.html" is empty then
> answer "The page doesn't exist."
> end if
That doesn't work either. As it turns out earlier posts covered this. . .MC
http protocol downloads the whole file. . .no way to just read header or
anything like that. I ended up downloading the file, if it doesn't exist,
you can test for 404 from the server.
put URL tLastYear into oneYearAgo
if oneYearAgo contains "404 Not Found" then
put "There was no page posted this day last year." into lastYearLink
else
buildLink
end if
Fortunately the app seeks only to check on the existence of very small html
files. Caveat of course is that the server might send some other message and
the test would be "wrong". And obviously this would not work efficiently for
testing the existence of a large .mov or .mpg file that might be several
megabytes in size. . .i.e. if the file exists you would download the entire
thing. . .
The other route would be to open a socket, use FTP and test from the
directory. . .but that's more complicated.
Sivakatirswami
Editor's Assistant/Production Manager
www.HinduismToday.com
www.HimalayanAcademy.com
[EMAIL PROTECTED]
Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.