Thema: Delphi Datasnap File Upload

Einzelnen Beitrag anzeigen

Benutzerbild von BeBored
BeBored

Registriert seit: 2. Jun 2004
Ort: Cremlingen
90 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#6

AW: Datasnap File Upload

  Alt 3. Dez 2011, 23:40
Hier mal die Upload Methode
Delphi-Quellcode:
function TServerMethodsClient.UploadFile(str: TStream; Store: string; fName: string): Boolean;
begin
  if FUploadFileCommand = nil then
  begin
    FUploadFileCommand := FDBXConnection.CreateCommand;
    FUploadFileCommand.CommandType := TDBXCommandTypes.DSServerMethod;
    FUploadFileCommand.Text := 'TServerMethods.UploadFile';
    FUploadFileCommand.Prepare;
  end;
  FUploadFileCommand.Parameters[0].Value.SetStream(str, FInstanceOwner);
  FUploadFileCommand.Parameters[1].Value.SetWideString(Store);
  FUploadFileCommand.Parameters[2].Value.SetWideString(fName);
  FUploadFileCommand.ExecuteUpdate; // Genau hier gibt es dann die Exception
  Result := FUploadFileCommand.Parameters[3].Value.GetBoolean;
end;
Vielleicht hilft es ja
Matthias
Wer nichts wagt der nichts verliert.
  Mit Zitat antworten Zitat