CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Change file name on upload

by DiogoM » 27 Apr 2016 16:21

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;
DiogoM
 
Posts: 2
Joined: 11 Jun 2015 12:09

by Alexander Bulei » 27 Apr 2016 17:02

Hi DiogoM,

Check the parameters of event:

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

They are variables.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by DiogoM » 27 Apr 2016 17:48

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
DiogoM
 
Posts: 2
Joined: 11 Jun 2015 12:09

by Alexander Bulei » 27 Apr 2016 17:55

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.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQFileUpload

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.