TIWAdvImageButton / path rendering bug ?

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.


Does it work when using a hard-coded filename?

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.


Have you tried to put your image file directly in the Files folder and then change your code like this: Pic1.FilePicture  := '\Files\1_1M.jpg';?

If the problem persists, you can have a look at a sample project (http://www.tmssoftware.net/public/testAdvImage.zip), which is working as expected.