In an android app that I made with Delphi I want to show photos from the database. When there is are 10 photos and let’s say 2 are missing I want to show a message which photos are missing and continue to show the 8 photos that are available.
So the filename is in the database but the real photo cant be found in the file.
This is the code on the client side
procedure TfmMain.Button42Click(Sender: TObject);
i : Integer;
FN : String;
if dm.mtObjectphoto.RecordCount>0 then
for I := 0 to DM.mtObjectphoto.RecordCount-1 do
FN := ffotopath+DM.mtObjectphoto.FieldByName(‘filename’).Value;
If not (system.SysUtils.fileexists(FN)) then
TV1.Items.Items[i].Caption := ‘photo’;
With ‘getobjectfoto’ i call the database for gathering the photos that belong to the object
this is the ‘downloadfile’ on the server-side
if fileexists(fphotomap+FilenameAtServer) then
Result := TMemoryStream.Create;
FileSize := Result.Size;
Result.Position := 0;
FileSize := -1;
fphotomap is just a directory on the server lets say C:\test
filenameatserver is the photoname that is saved in the database
Again the photo is not in the map but the data is in the database.
If i missed important data please let me know i correct it asap.