I assign a Path to an TIWAdvImageButton:
if FileExists(ServerController.UserSession.AppPath+'\Files\Portraits'+IntToStr(ServerController.UserSession.UserId)+'_1M.jpg') or
FileExists(ServerController.UserSession.AppPath+'\Files\PortraitsToVerify'+IntToStr(ServerController.UserSession.UserId)+'_1M.jpg') then
begin
if FileExists(ServerController.UserSession.AppPath+'\Files\Portraits'+IntToStr(ServerController.UserSession.UserId)+'_1M.jpg') then
Pic1.FilePicture := '\Files\Portraits'+IntToStr(ServerController.UserSession.UserId)+'_1M.jpg'
else
Pic1.FilePicture := '\Files\PortraitsToVerify'+IntToStr(ServerController.UserSession.UserId)+'_1M.jpg';
end;
At the end Pic1.FilePicture should look like:
http://127.0.0.1:8888/FilesPortraitsToVerify/1_1M.jpg
but I get: http://127.0.0.1:8888/FilesPortraitsToVerify_1M.jpg
resulting in a broken link.
Regards
Michael
I have not been able to reproduce this issue.
Ich changed the code to:
if FileExists(ServerController.UserSession.AppPath+'\Files\Portraits'+IntToStr(ServerController.UserSession.UserId)+'_1M.jpg') then
Path := '\Files\Portraits'+IntToStr(ServerController.UserSession.UserId)+'_1M.jpg'
else
Path := '\Files\PortraitsToVerify'+IntToStr(ServerController.UserSession.UserId)+'_1M.jpg';
end;
Pic1.FilePicture:=Path;
I checked the "path" value in debug-mode and it contains the correct path. But it's still rendered wrong resulting in: http://127.0.0.1:8888/FilesPortraitsToVerify_1M.jpg
Doesn't work hardcoded either:
Pic1.FilePicture := '\Files\PortraitsToVerify\1_1M.jpg';
->http://127.0.0.1:8888/FilesPortraitsToVerify_1M.jpg
AFAIK IntraWeb will not display image files that are in a subfolder of Files.