Page 1 of 2

Downloads don't work

PostPosted: 10 Jun 2013 14:50
by kmartens
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!

Re: Downloads don't work

PostPosted: 10 Jun 2013 16:16
by Jorge Sousa
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

Re: Downloads don't work

PostPosted: 29 Aug 2013 10:26
by Soren SDF
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

Re: Downloads don't work

PostPosted: 29 Aug 2013 11:11
by Jorge Sousa
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

Re: Downloads don't work

PostPosted: 30 Aug 2013 10:39
by Soren SDF
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

Re: Downloads don't work

PostPosted: 30 Aug 2013 11:38
by Jorge Sousa
Hi Sören

In what IW version? And cg version?

Thanks

Re: Downloads don't work

PostPosted: 30 Aug 2013 11:42
by Soren SDF
Delphi XE2 with IW 14.0.13 and CGDevTools 1.6.0.2813

As previously stated. :-)

Sören

Re: Downloads don't work

PostPosted: 30 Aug 2013 13:23
by Jorge Sousa
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.

Re: Downloads don't work

PostPosted: 30 Aug 2013 14:42
by Jorge Sousa
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

Re: Downloads don't work

PostPosted: 08 Nov 2013 14:31
by George
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.