Not sure if this is the right place to make this comment but the 2nd demo does not remove the chunks. Therefore I modified the function inside mwx2Main to:
procedure TForm1.btnDeleteClick(Sender: TObject);
var
li:TListItem;
begin
li:=ListView1.Selected;
if li<>nil then
if MessageBox(Handle,PChar('Are you sure to delete "'+li.Caption+'"?'),
'mwx2',MB_OKCANCEL or MB_ICONQUESTION)=idOK then
begin
FDB.Delete(FilesCollection+'.files',BSON(['_id',li.SubItems[siID]]));
FDB.Delete(FilesCollection+'.chunks',BSON(['files_id',li.SubItems[siID]])); //Added
li.Delete;
end;
end;
Not sure if this is the right place to make this comment but the 2nd demo does not remove the chunks. Therefore I modified the function inside mwx2Main to:
procedure TForm1.btnDeleteClick(Sender: TObject); var li:TListItem; begin li:=ListView1.Selected; if li<>nil then if MessageBox(Handle,PChar('Are you sure to delete "'+li.Caption+'"?'), 'mwx2',MB_OKCANCEL or MB_ICONQUESTION)=idOK then begin FDB.Delete(FilesCollection+'.files',BSON(['_id',li.SubItems[siID]])); FDB.Delete(FilesCollection+'.chunks',BSON(['files_id',li.SubItems[siID]])); //Added li.Delete; end; end;
This seems to do the trick