CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Downloads don't work

by kmartens » 10 Jun 2013 14:50

Hi,

I am using 1.5.4.2397 in XE3 upd2 with Intraweb 14.0.10
The download component in the demo project JQueryDemoIW14 don't work. Only the Url download from an external url (the sysinternals download) works. All other downloads just dont' responde. When in callback mode it says "Fail". I looked in the code there seems to be an issue in IW14

procedure TIWJQDownloadFrame.IWCGJQButton3JQButtonOptionsClick(Sender: TObject; AParams: TStringList);
var
FileName: string;
URL: string;
CacheFileName: string;
begin
// Copy file to cache folder
// Url will be without 'http' perfix, Example: /$/Cache/user/1jfid1q0vc88st166wror0nbi0mm/TestFile.txt
FileName:= GetFileName;
CacheFileName:= WebApplication.UserCacheDir + ExtractFileName(FileName);
Windows.CopyFile(PWideChar(FileName),PWideChar(CacheFileName),False);
URL:= IWServerController.CacheDir + ExtractFileName(CacheFileName);
IWCGJQFileDownload.DownloadUrl(URL);
end;

You use IWServerController.CacheDir to get the url for the cacheDir. But in IW14 I think it should be WebApplication.UserCacheUrlBase because IWServerController.CacheDir returns a local path and not a url as you comments suggest. WebApplication.UserCacheUrlBase does return a Url. So I changed the code to:
url := WebApplication.UserCacheUrlBase + ExtractFileName(CacheFileName);


But it still doesn't work.

please help!
kmartens
 
Posts: 10
Joined: 10 Jun 2013 14:31

by Jorge Sousa » 10 Jun 2013 16:16

Hi kmartens


The problem with your code is that

or you use

FileName:= IWServerController.CacheDir + ExtractFileName(CacheFileName);

IWCGJQFileDownload.DownloadFileName(FileName);

or

URL:= IWServerController.UserCacheUrl + ExtractFileName(CacheFileName);

IWCGJQFileDownload.DownloadUrl(URL);

Best Regards

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

by Soren SDF » 29 Aug 2013 10:26

I have exactly the same problem. Doesn't work with either TIWCGJQFileDownload or TIWCGJQFileDownload or TIWCGJQMFileDownload.
I'm running the demo on Delphi XE2 with IW 14.0.13 and CGDevTools 1.6.0.2813.
I'm compiling and running the JQDownload_IW14 demo.

Thanks in advance
Sören A
Soren SDF
 
Posts: 87
Joined: 19 Apr 2013 15:56

by Jorge Sousa » 29 Aug 2013 11:11

Hi Soren

What

Doesn't work with either TIWCGJQFileDownload or TIWCGJQFileDownload or TIWCGJQMFileDownload.
?

DownloadFileName or DownloadUrl?

If it's DownloadUrl,

IWServerController.UserCacheUrl

is not longer available.

How are you getting the Url ?

Regards

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

by Soren SDF » 30 Aug 2013 10:39

I'm actually running the demo project from CGDevTools.
There are four buttons.

Download from server (DownloadFileName = Triggers Fail Event)
Download from URL (DownloadUrl, External URL = Works)
Download from URL (server) (DownloadUrl, internal = Triggers Fail Event)
Broken Download (DownloadUrl, internal non existent file = Triggers Fail Event)

I changed IWServerController.UserCacheUrl in the handler of button 3 to WebApplication.UserCacheUrlBase but it still fails.

Regards
Sören
Soren SDF
 
Posts: 87
Joined: 19 Apr 2013 15:56

by Jorge Sousa » 30 Aug 2013 11:38

Hi Sören

In what IW version? And cg version?

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

by Soren SDF » 30 Aug 2013 11:42

Delphi XE2 with IW 14.0.13 and CGDevTools 1.6.0.2813

As previously stated. :-)

Sören
Soren SDF
 
Posts: 87
Joined: 19 Apr 2013 15:56

by Jorge Sousa » 30 Aug 2013 13:23

Hi Sören

Sorry, I didn't read your previous post.

Confirmed, it's not working in IW14 only!

We didn't changed nothing our code, is another IW break change.

But we need to find a way!

Thanks for your report.
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 Aug 2013 14:42

Hi again

Reported to Atozed - WebApplication.SendStrem in event handler not working.

As you see

http://www.cgdevtools.com/demo/JQueryDemoIW12_V2_ISAPI.dll/?Frame=Download


It's working

I'm sure it will be soon fixed, since we are in close contact with Mr. Alexandre Machado

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 » 08 Nov 2013 14:31

DownloadUrl not working when trying to download image.
pascal code
wFileDownload.DownloadUrl('http://127.0.0.1:10700/fstorage/Desert.jpg');


Link is correct, other files such as 7z downloads as expected.
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

Next

Return to JQFileDownload

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.