Read File Contents

Hi,

How can I read the contents of a client side file? I don't want to upload it to the server.

Thanks,

Ken

You would need to use a TWebFilePicker.

Implement OnChange and OnGetFileAsText with:
procedure TForm3.WebFilePicker1Change(Sender: TObject);
begin
  if WebFilePicker1.Files.Count > 0 then
     WebFilePicker1.Files[0].GetFileAsText;
end;

procedure TForm3.WebFilePicker1GetFileAsText(Sender: TObject;
  AFileIndex: Integer; AText: string);
begin
  WebMemo1.Lines.Text := AText;
end;

Thanks but I can't find TWebFilePicker, just TWebFileUpload.

It should be in TMS WEB Core v1.2

I can see it in WEBLib.WebCtrls but not in the list of components.

I cannot see a cause of this. It is being registered for the tool palette.
As a workaround, try to create it at runtime in code.