CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Functionality

by George » 06 Nov 2013 09:49

Hi!

I'm clearly understand how works TIWFileUploader.
delphi code
IWFileUploader1AsyncUploadCompleted(Sender: TObject; var DestPath, FileName: string; var SaveFile, Overwrite: Boolean)
I can implement custom file processing when SaveFile = False.
IW will create cache file with unique name, when upload is complete IW will move temp cache file to DestPath and rename it to FileName.

What with TIWCGJQFileUpload?
If jqfileuploadoptions.UploadPath is empty then TIWCGJQFileUpload saves file to cache dir with original file name (corresponding error ticket).
I can rename file or move it manually onUploadComplete, but what if user uploads 2 or more files with same name at same time.
How to override temp file name in user cache dir?

delphi code
procedure TFrameFileUpload.IWCGJQFileUpload1JQFileUploadOptionsSubmit(Sender: TObject; AParams: TStringList);
begin
// IWCGJQFileUpload1.FileNames.Count = 0
end;


delphi code
procedure TFrameFileUpload.IWCGJQFileUpload1JQFileUploadOptionsUpload(Sender: TObject; AParams: TStringList);
begin
// IWCGJQFileUpload1.FileNames.Count = 1; File already created with original file name in user cache dir.
end;
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Jorge Sousa » 06 Nov 2013 10:35

Hello George

You've the event OnGetFileName, does it fit your needs?

Regards
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 » 06 Nov 2013 11:07

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 » 06 Nov 2013 11:14

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

by George » 06 Nov 2013 11:40

cgdevtools_support wrote:Hello George
You've the event OnGetFileName, does it fit your needs?
Regards

Yes ;)
Forgot to look at base events...

cgdevtools_support wrote:Hi again
This,
http://www.cgdevtools.com/cgforum/tracker.php?p=1&t=99
we just fixed
Also this
tracker.php?p=1&t=98
Regards

Great!
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by George » 06 Nov 2013 16:00

From manual:
AllowedExtensions for validation // ex. ['jpg', 'jpeg', 'png', 'gif'] or []

I tried to set ["jpg", "jpeg", "png", "gif", "rar", "zip", "7z"] - json valid array
and ['jpg', 'jpeg', 'png', 'gif', 'rar', 'zip', '7z'] - json invalid array
But files cannot be selected with message "invalid extension".
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Jorge Sousa » 06 Nov 2013 16:12

George

Add one by line like in a string list

jpg
jpeg
png
gif
rar
zip
7z

What you're saying is only valid when the property is TIWCGJson type, not TIWCGJSonSimpleArray, that is case, and translates a stringlist to a json array automatically.

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

by George » 20 Nov 2013 13:52

How to disable drop zone?
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Jorge Sousa » 20 Nov 2013 16:04

hi

set both

JQFileUploadOptions.Drop = 'qq-upload-drop-area-disabled'
JQFileUploadOptions.DropActive = 'qq-upload-drop-area-disabled'

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


Return to JQFileUpload

cron

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.