CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Invalid URL on ISAPI when using Datalink

by kmccoy » 08 Jan 2015 21:59

JQImage (7 January 2015 version) works OK in Intraweb Stand-alone apps. It fails when using ISAPI/SSL.

In Stand-Alone EXE apps, JQImage uses a URL something like this for displaying blob images stored in a database table:

Code: Select all
src="/$/temp/ABCDEF1234567890"


This works fine.

However, if you recompile the same source code into an ISAPI DLL for Apache, JQImage sends image URLs to the browser like so:

Code: Select all
src="/mydll.dll/mydll.dll/$/temp/ABCDEF1234567890"


This is obviously an invalid URL, and shows the "broken picture" icon instead of the proper image. I am using SSL on the Apache server, but I don't think this has any impact on the URL generation.

If you edit the URL using FireFox/Firebug and manually change the URL to:

Code: Select all
src="/mydll.dll/$/temp/ABCDEF1234567890"


It works OK and shows the correct image. In all of my examples "ABCDEF1234567890" is actually some large random hex number.

So, I can only conclude that you are incorrectly prepending the ISAPI DLL name to the URL twice. Is there a property I need to change, or is this a bug?

Here is the DFM snippet for the image component:

Code: Select all
      object imgUserImage: TIWCGJQImage
        Left = 672
        Top = 94
        Width = 347
        Height = 244
        Hint = 'Click Add Photo button to upload a picture of this person'
        TabOrder = 32
        Version = '1.0'
        BorderOptions.NumericWidth = 8
        BorderOptions.Style = cbsRidge
        BorderOptions.Color = clWebCHOCOLATE
        ParentShowHint = False
        ShowHint = False
        DataLink.DataSource = IWUserSession.dsMupuImages
        DataLink.FieldName = 'filedata'
        Proportional = True
        Center = True
      end
Best Regards,

Kevin G. McCoy
kmccoy
 
Posts: 90
Joined: 08 Oct 2012 13:01

by Jorge Sousa » 09 Jan 2015 11:29

Hi Kevin

Confirmed, but we didnt changed a bit. Intraweb did.

To be fixed asap!
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 » 09 Jan 2015 12:15

Hi again

We cannot fix from our side

Here's the code:

Code: Select all
procedure TIWCGJQCustomImage.UpdatePicture;
var
  BlobStream: TStream;
  FileName: string;
  FileStream: TFileStream;
begin
  if Assigned(DataLink.Field) and (DataLink.Field.DataType in [ftGraphic,ftBlob]) and not DataLink.Field.IsNull then
  begin
    FileName:= CGNewGUIDHTMLMapID + '.tmp';
    BlobStream:= nil;
    FileStream:= nil;
    try
      BlobStream := DataLink.DataSource.DataSet.CreateBlobStream(DataLink.Field,bmRead);
      {$IFDEF IW14UP}
      FileStream:= TFileStream.Create(GServerController.CacheDir + FileName,fmCreate);
      {$ELSE}
      FileStream:= TFileStream.Create(GServerController.UserCacheDir + FileName,fmCreate);
      {$ENDIF}
      if (DataLink.Field is TGraphicField) and TGraphicField(DataLink.Field).GraphicHeader then
      begin
        BlobStream.Seek(8,soFromBeginning);
        FileStream.CopyFrom(BlobStream,BlobStream.Size-8);
      end
      else
      begin
        FileStream.CopyFrom(BlobStream,0);
      end;
    finally
      FileStream.Free;
      BlobStream.Free;
    end;
    {$IFDEF IW14UP}
    Picture.Url:= TIWAppCache.AddFileToCache(GGetWebApplicationThreadVar,GServerController.CacheDir + FileName,'');
    {$ELSE}
    Picture.Url:= GServerController.UserCacheURL + FileName;
    {$ENDIF}
  end
  else
    Picture.Url:= '';
end;


Contacting Atozed.....
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 » 12 Jan 2015 17:06

Hi

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

by kmccoy » 12 Jan 2015 17:08

Jorge,

Where can I find the fix? Did AtoZed do a new release or did you?

Thanks!

Kevin
Best Regards,

Kevin G. McCoy
kmccoy
 
Posts: 90
Joined: 08 Oct 2012 13:01

by Jorge Sousa » 12 Jan 2015 17:15

Hello

Tomorrow it will be available for download.

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

by kmccoy » 12 Jan 2015 17:16

Jorge,

Excellent! Thank you very much!

Kevin
Best Regards,

Kevin G. McCoy
kmccoy
 
Posts: 90
Joined: 08 Oct 2012 13:01

by Jorge Sousa » 12 Jan 2015 17:17

Kevin

You're welcome :) Our apologies
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by kmccoy » 13 Jan 2015 20:06

Jorge Sousa wrote:Tomorrow it will be available for download.
We fixed on our side.


Tomorrow is now today :-)

I downloaded the new Development release. Sadly, there was no mention of JQImage fixes in the changelog. After testing, I still have the same problem on ISAPI.
Best Regards,

Kevin G. McCoy
kmccoy
 
Posts: 90
Joined: 08 Oct 2012 13:01

by Jorge Sousa » 14 Jan 2015 10:25

Hi

I forgot to add to changelog, but its working.

Please add a CGImage to the frame CGJQueryGridDB.pas, set the DataLink to Graphic field. Thats what i did to test.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

Next

Return to JQImage

cron

Who is online

Users browsing this forum: No registered users and 3 guests

Contact Us.