Page 1 of 1

Change file name on upload

PostPosted: 27 Apr 2016 16:21
by DiogoM
How can i change the name of the file i upload?

i've tried somesthing like this but it didn't work:

procedure TIWForm1.IWCGJQFileUpload1GetFileName(Sender: TObject; var APath,
AFileName: string);
begin
IWCGJQFileUpload1.JQFileUploadOptions.FileUpload.Name:='sometext';
end;

Re: Change file name on upload

PostPosted: 27 Apr 2016 17:02
by Alexander Bulei
Hi DiogoM,

Check the parameters of event:

procedure TIWForm1.IWCGJQFileUpload1GetFileName(Sender: TObject; var APath, AFileName: string);

They are variables.

Best Regards.

Re: Change file name on upload

PostPosted: 27 Apr 2016 17:48
by DiogoM
Alexander Bulei wrote:Hi DiogoM,

Check the parameters of event:

procedure TIWForm1.IWCGJQFileUpload1GetFileName(Sender: TObject; var APath, AFileName: string);

They are variables.

Best Regards.


Thanks for your reply!


I dont' see how they help me... I am probably using the wrong event to what i pretend to do..


I want to upload a file named "aaa". But i want to change that name to "bbb" on upload in runtime. (change the file name before it is saved in the folder) .

Thanks

Re: Change file name on upload

PostPosted: 27 Apr 2016 17:55
by Alexander Bulei
Hi DiogoM,

Sorry for asking, but are you new programmer in delphi?

Answer: Since they are variables, you can change them directly:

delphi code
AFileName:= 'bbb.txt';


Best Regards.