Text
|
Caravan invokes special file (fixed file name) to handle error (error404.html). You can write your code in it to take whatever action is required.
When ever the browser gives an error (File not found, Downloads) etc, Error404.html is invoked.
Example: //This file is used to download an attahcment file from any of the folders.
<head> </head> <caravan> if form(action) if form(action)="download" table mytable=form(db).form(tb) mytable(recordno)=form(id) mytable(recordno) var _response _response(content-type)="unknown/unknown" dispatch mytable(AttachmentFiles) endif over endif </caravan> <P align=center>The requested file is not found</P> <P align=center>Caravan Server</P> </BODY> </HTML>
Example: <caravan> if form table mytable=form(db).form(tb) mytable(recordno)=form(id) var _response if form(tb)="remoteinfo" var tfile tfile(path)=mytable(SavedPath) tfile(path(01))+="\\" tfile(path(01))+=mytable(filename) file f=tfile(path(01)) else var tfile tfile(path)=mytable(CopiedTo) tfile(path(01))+="\\" tfile(path(01))+=mytable(filename) file f=tfile(path(01)) endif f(file) _response(content-type)="unknown/unknown" dispatch f(file) endif </caravan> <P align=center> The requested file is not found on Server </P> <P align=center> Caravan Server </P>
|