Jump to content

How do I get the real file name with FileUploadButton?


eduardosuruagy

Recommended Posts

3 hours ago, eduardosuruagy said:

How do I get the real file name with FileUploadButton?

My file name is Image.jpg, but when I uploaded it with the FileUploadButton component I can't get its real name even using the AStream.FileName command. The UniFileUpload component shows me the actual file name after upload.

Hello,

At what point and for what purpose do you want to get it?

Link to comment
Share on other sites

1 hour ago, Sherzod said:

Qual evento você está usando?

procedure TFormCadRelatoriosSistema.UniFileUpload1Completed(Sender: TObject; AStream: TFileStream);
var DestName   : string;
    DestFolder : string;
begin
  DestFolder := UniServerModule.StartPath+'UploadFolder\';
  DestName   := DestFolder+ExtractFileName(AStream.FileName);

  if not DirectoryExists(DestFolder) then
    ForceDirectories(DestFolder);

  CopyFile(PChar(AStream.FileName), PChar(DestName), False);

  EDIT_NOME_ARQUIVO.Text := ExtractFileName(DestName);
end;
 

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...