Hi Chris, How about posting a little code. Also, maybe add some code to show the filename your passing to fileexists. Maybe its not what you think it is.
Scott Kellish [EMAIL PROTECTED]
Okey Dokey, here'tis:
This code ALWAYS displays 106.jpg
procedure TWebForm1.Button1_Click(sender: System.Object; e: System.EventArgs);
var
myFile:String;
b:Boolean;
begin
if TextBox1.Text='Put Your Name Here' then
Label1.text:='Hello Stupid'
else
Label1.text:='Hello '+ TextBox1.Text;myFile:='\\svr-dat-01\S_Drive\Data\Bases\Personnel\Clox\'+TextBox1.Text+'.jpg';
b:=fileexists(myFile);
if b then
Image1.ImageUrl:=myFile
else
Image1.ImageUrl:='\\svr-dat-01\S_Drive\Data\Bases\Personnel\Clox\106.jpg';
TextBox1.Text:='Put Your Name Here';
end;This code displays different .JPG's, or an image holder if the .JPG does not exist :
procedure TWebForm1.Button1_Click(sender: System.Object; e: System.EventArgs);
var
myFile:String;
begin
if TextBox1.Text='Put Your Name Here' then
Label1.text:='Hello Stupid'
else
Label1.text:='Hello '+ TextBox1.Text;myFile:='\\svr-dat-01\S_Drive\Data\Bases\Personnel\Clox\'+TextBox1.Text+'.jpg';
Image1.ImageUrl:=myFile; TextBox1.Text:='Put Your Name Here'; end;
Hope this sheds some light.
----- Original Message ----- From: "Chris Moore" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Thursday, May 05, 2005 8:29 AM Subject: Delphi 8 FileExists
> Hello list > I am developing a web app that presents images to a viewer depending on > choices made from a web browser. > > If the image exists (fileexists function) show it, other wise show a > default image. > fileexists ALLWAYS returns false. I can view all the images if I do not > error check. Any Ideas? > > Mr Chris Moore > Systems Engineer > > Brother Industries (UK) Limited > Tel: +44(0) 1978 813 425 > Fax: +44(0) 1978 813 495 > > > > > > _______________________________________________ > Delphi mailing list -> [email protected] > http://www.elists.org/mailman/listinfo/delphi >
_______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi
Mr Chris Moore Systems Engineer
Brother Industries (UK) Limited Tel: +44(0) 1978 813 425 Fax: +44(0) 1978 813 495
_______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

