[fpc-pascal] Troubles using embedded HTTP Server to serve SWF files

Graeme Geldenhuys graeme at geldenhuys.co.uk
Thu Oct 10 11:55:38 CEST 2013


Hi,

I'm using the FPC HTTP Server component as an embedded web server in our
application. All content is generated dynamically via a CGI application.
I hit a [rather big] snag serving SWF flash content. During my
debugging, I eliminated the usage of a CGI app, and reference the SWF
file directly in the URL to see if I could get to the bottom of this issue.

The FPC web server has no problem serving plain jane (self contained
stand-alone) SWF files, but we do nothing standard here. :) Our SWF
files load external resources (shared files) located in a "resources"
directory.

eg:

   <web_root>/flash/somefile.swf
   <web_root>/flash/resources/res01.swf
   <web_root>/flash/resources/res02.swf
   <web_root>/flash/resources/res03.swf
   <web_root>/flash/resources/res04.swf

For some reason using the embedded FPC HTTP Server, the somefile.swf can
not find the "resources" directory, thus no res*.swf files are loaded.

Now if I use the above directory layout, and use Apache Web Server, and
tell the Web Browser to directly load the /flash/somefile.swf, then it
finds the "resources" directory just fine, and the flash movie is
displayed perfectly.

Doing the same test with FPC's HTTP Server, no resources are found or
loaded. I even tried creating a static .html file which then displays
the SWF file, but that doesn't work either.

Any ideas on what can be different between this test and using FPC or
Apache's Web Server? I've been battling with this problem for nearly a
week now, and the boss is breathing down my neck already! :-/

Does SWF files maybe need some special environment variable set, so it
knowns what the "current directory" is? I have no idea. Is there a way I
can test this? Is there a Firefox/Chrome browser plugin that could
inspect and display environment variable values, even if just a SWF file
is placed in the URL?

Any thoughts or suggestions would be greatly appreciated.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/




More information about the fpc-pascal mailing list