Recent

Author Topic: pathing issue? fpweb / HTTP Server Application  (Read 18731 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: pathing issue? fpweb / HTTP Server Application
« Reply #15 on: June 24, 2012, 11:53:35 am »
Compiled it using x86 Laz 1.1 (SVN today), FPC 2.6.1 (SVN today), Windows Vista x64
This URL
Code: [Select]
http://localhost:8081/main/default gives this page source:

Code: [Select]
<html>
<body>
    <h1> Main Page </h1>
    <img src="/img/mos.gif" alt="this is some image"/>
</body>
</html>
... but no mos.gif is shown... I get the alt text.

Direct image link:
Code: [Select]
http://localhost:8081/img/mos.gif gives an error, no image

Is this how I should test it?
« Last Edit: June 24, 2012, 11:55:43 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: pathing issue? fpweb / HTTP Server Application
« Reply #16 on: June 24, 2012, 02:12:55 pm »
Leledumbo - requesting the image directly (via:http://localhost:8081/img/mos.gif) shows a blank page.  When I view the source of that page, it is also blank.

I did add a .jpg image on my web page to see this was an issue with .gif's.  I was not able to see either image.

BigChimp - that is the result I get as well.  I see the text but not the image, although I'm not getting an error when I view the image via http://localhost:8081/img/mos.gif with firefox.  When using IE8, I do get the message: webpage cannot be found.

Yes I believe this is how we should be testing it.

But Leledumbo does see the image.  I'm confused.

BigChimp - what setup are you using?

IPGuy - Laz 1.1-37738-2.6.1, win32-Vista
Leledumbo -
    Kubuntu 12.04 & Windows XP SP3, all 32-bit
    FPC 2.7.1 r21512
    Laz 1.1 r37563M

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: pathing issue? fpweb / HTTP Server Application
« Reply #17 on: June 24, 2012, 04:20:41 pm »
Quote from: IPguy
BigChimp - what setup are you using?
x86 Laz 1.1 (SVN today), FPC 2.6.1 (SVN today), Windows Vista x64
Quote from: IPGuy
via http://localhost:8081/img/mos.gif with firefox.  When using IE8, I do get the message: webpage cannot be found.
Yep, that's what I'm talking about - tested in IE. With either IE or Firefox, I don't get the image.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: pathing issue? fpweb / HTTP Server Application
« Reply #18 on: June 24, 2012, 04:23:29 pm »
My bad... looks like I forgot one line in the .lpr:
Quote
...
ImageDir  := GetCurrentDir + DirectorySeparator;
MimeTypesFile := 'mime.types';
RegisterFileLocation('img',ImageDir);
...
Please add the bold line. Somehow Chrome (sorry, I didn't say it earlier. I quit using FF and IE since I found Chrome) is able to detect the real content type despite it's sent as application/octet-stream.
« Last Edit: June 24, 2012, 04:25:50 pm by Leledumbo »

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: pathing issue? fpweb / HTTP Server Application
« Reply #19 on: June 24, 2012, 04:49:57 pm »
I've been using FF, IE and Chrome.  No luck with any of them.

Leledumbo, I added the mime line to the .lpr, but that did not make any difference.  I still do not see an image.  No difference if I run the app inside the IDE or outside the IE.

One difference between our setups is that Leledumbo is using 2.7.1 and BigChimp and I are using 2.6.1. 

If there are no other thoughts, I'll open a bug report on this.

Thanks for your help.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: pathing issue? fpweb / HTTP Server Application
« Reply #20 on: June 24, 2012, 06:29:23 pm »
Quote
One difference between our setups is that Leledumbo is using 2.7.1 and BigChimp and I are using 2.6.1
That could be the problem or not. Could you try diff-ing the 2.7.1 and 2.6.1 source of fcl-web?

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: pathing issue? fpweb / HTTP Server Application
« Reply #21 on: June 24, 2012, 09:33:59 pm »
comparing 2.6.1, dated 2012/6/23 & 2.7.1-v21686:

httpdefs.pp differs
   adding free content stream code

custweb.pp differs
   added new property - defaultModuleName & associated code

I'll attempt switching over to 2.7.1 and see if that makes a difference.

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: pathing issue? fpweb / HTTP Server Application
« Reply #22 on: July 06, 2012, 01:16:58 am »
Finally have fpc 2.7.1 installed.

No change - I still do not see the images.
I'm going to open a bug report.

Using laz-1.1-37884, fpc 2.7.1 21798, win32-Vista....

 

TinyPortal © 2005-2018