Download files to custom location
Posted: Tue Feb 02, 2021 10:46 am
Hi,
I am using CEF binaries 86.0.23 and FMXBrowser component.
one of the web page is trying to save csv file on the disk by opening a save as dialog box.
I have implemented below in my form :
procedure TMainForm.FMXChromium1BeforeDownload(Sender: TObject; const browser: ICefBrowser;
const downloadItem: ICefDownloadItem; const suggestedName: ustring;
const callback: ICefBeforeDownloadCallback);
var
S: string;
begin
S := ExtractFilePath(ParamStr(0));
callback.cont(S + suggestedName, false);
end;
But, It is always saving file in the exe path, its not showing that popup which asks user to select location to save file.
Any advises ?
Thanks.
I am using CEF binaries 86.0.23 and FMXBrowser component.
one of the web page is trying to save csv file on the disk by opening a save as dialog box.
I have implemented below in my form :
procedure TMainForm.FMXChromium1BeforeDownload(Sender: TObject; const browser: ICefBrowser;
const downloadItem: ICefDownloadItem; const suggestedName: ustring;
const callback: ICefBeforeDownloadCallback);
var
S: string;
begin
S := ExtractFilePath(ParamStr(0));
callback.cont(S + suggestedName, false);
end;
But, It is always saving file in the exe path, its not showing that popup which asks user to select location to save file.
Any advises ?
Thanks.