CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Multiple File Uploads

by aknapple » 30 Jul 2014 16:10

When using multiple file uploads how can you tell the last file has been uploaded?

Thanks,
Allen
aknapple
 
Posts: 3
Joined: 24 Oct 2012 21:12

by Jorge Sousa » 30 Jul 2014 16:16

Hello Allen

As you can see in the documentation

you can use the property FileUpload.FileNames

FileUpload.FileNames.Names[i] contains the upload name, and FileUpload.FileNames.ValuesByIndex[i] the output complete path.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Jorge Sousa » 30 Jul 2014 16:16

Hello Allen

As you can see in the documentation

you can use the property FileUpload.FileNames

FileUpload.FileNames.Names[i] contains the upload name, and FileUpload.FileNames.ValuesByIndex[i] the output complete path.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by aknapple » 30 Jul 2014 16:59

I don't understand how. Can you give me an example? I am looking for a way to know the entire upload is complete. I was looking for something like an OnDone event. OnComplete doesn't work because it gets called for each file downloaded. There is nothing to tell me it's the last file. I'm not sure how having the list of filenames and paths helps because I don't know how many files the user is going to select.

Thanks,
Allen
aknapple
 
Posts: 3
Joined: 24 Oct 2012 21:12

by Jorge Sousa » 30 Jul 2014 17:19

Hi

Check the JQueryDemo_V2 in the upload frame
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by DidierL » 04 Aug 2015 23:50

Hi,
I have the same need for a final OnComplete event.
I've dig throught the demo code with no response, this code is executed for each file.
So one must maintain an external index to avoid processing several time the same.
Thank you if you can provide a simpler solution.
DidierL
 
Posts: 28
Joined: 30 May 2013 21:29

by DidierL » 05 Aug 2015 00:05

Or maybe show I use UploadingFileList property?
DidierL
 
Posts: 28
Joined: 30 May 2013 21:29

by Alexander Bulei » 05 Aug 2015 09:28

Hi DidierL,

You can use the follow code:

delphi code
procedure TIWForm3.IWAppFormCreate(Sender: TObject);
begin
IWCGJQFileUpload1.JQFileUploadOptions.OnComplete.Condition:= Format('(%s_JQObj._uploadingList._filelist.length == 0)',[IWCGJQFileUpload1.JQHTMLName]);
end;


The OnComplete event will fire only when finish the last file upload.

Topic: viewtopic.php?f=40&t=2397

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 DidierL » 05 Aug 2015 22:24

Thanks!
It is really powerful.
DidierL
 
Posts: 28
Joined: 30 May 2013 21:29

by zsleo » 17 Jul 2019 07:57

The code appears to be incorrect. Please advise correction

Code: Select all
procedure TIWForm3.IWAppFormCreate(Sender: TObject);
begin
  IWCGJQFileUpload1.JQFileUploadOptions.OnComplete.Condition:= Format('(%s_JQObj._uploadingList._filelist.length == 0)',[IWCGJQFileUpload1.JQHTMLName]);
end;



Also, How can I display an error message from within the IWCGJQFileUpload1BeforeSubmitEx event
zsleo
 
Posts: 776
Joined: 03 Feb 2013 03:33

Next

Return to JQFileUpload

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.