eduardosuruagy Posted August 28, 2019 Share Posted August 28, 2019 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 28, 2019 Share Posted August 28, 2019 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? Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted August 28, 2019 Author Share Posted August 28, 2019 3 hours ago, Sherzod said: Olá, Em que ponto e com que objetivo você deseja obtê-lo? I want to show the user the original file name and not a unigui generated name. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 29, 2019 Share Posted August 29, 2019 14 hours ago, eduardosuruagy said: I want to show the user the original file name and not a unigui generated name. Which event are you using? Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted August 29, 2019 Author Share Posted August 29, 2019 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; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 29, 2019 Share Posted August 29, 2019 procedure TMainForm.UniFileUpload1Completed(Sender: TObject; AStream: TFileStream); begin ShowMessage(UniFileUpload1.FileName); end; Quote Link to comment Share on other sites More sharing options...
benilton Posted November 24, 2019 Share Posted November 24, 2019 eu gostaria de quando pegar o arquivo para uploud renomear e guarda no diretório é possível? como fazer. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.