Forum: Ruby WEBrick and swf files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cde4ce7f2f5caf468c0a59c308368b9b?d=identicon&s=25 Eric Ching (eching)
on 2006-12-21 17:46
(Received via mailing list)
Hi, I am having trouble getting Mozilla firefox to load a swf file
served from WEBrick.  When I access the same file from another web
server in firefox, it works fine (apache, abyss, etc)

When I access the file from Internet Explorer 6 (served from WEBrick),
the swf file loads fine.  When I try from firefox, I am asked if I want
to download the file.

Here is what WEBrick logs when it serves the file:

localhost - - [21/Dec/2006:10:11:22 CST] "GET /hello.lzx.swf HTTP/1.1"
304 0

I checked in firefox options and it has swf files listed to be opened
with shockwave flash.  I also added "swf"   =>
"application/x-shockwave-flash" as a mime type in webrick (added to
httputils.rb)

I am a bit green at these finer points of HTTP so if anyone has a
suggestion or possible solution, I'd greatly appreciate it, as I'd hate
to have to use Internet explorer for this particular app.  I'd also
like to use WEBrick to serve the application.

Thanks in advance,
Eric
Ec5a599777854c540fd102ef4691fe10?d=identicon&s=25 Rimantas Liubertas (Guest)
on 2006-12-21 18:57
(Received via mailing list)
<...>
> When I access the file from Internet Explorer 6 (served from WEBrick),
> the swf file loads fine.  When I try from firefox, I am asked if I want
> to download the file.
>
> Here is what WEBrick logs when it serves the file:
>
> localhost - - [21/Dec/2006:10:11:22 CST] "GET /hello.lzx.swf HTTP/1.1"
> 304 0

Status code 304 "Not modified" means that server has the same version
of the file
as browser in it's cache. So in this case file won't be served and
browser will use
cached version.

> I checked in firefox options and it has swf files listed to be opened
> with shockwave flash.  I also added "swf"   =>
> "application/x-shockwave-flash" as a mime type in webrick (added to
> httputils.rb)

It would help to see full set of headers (you can use LiveHTTPHeaders
or Firebug extesnions for that), but I have a wild idea: can you try
to rename your swf from
hello.lzx.swf  to, say hello-lzx.swf maybe something along the path
thinks that
.lzx is extension of the file, not .swf....


Regards,
Rimantas
Cde4ce7f2f5caf468c0a59c308368b9b?d=identicon&s=25 Eric Ching (eching)
on 2006-12-21 19:41
(Received via mailing list)
> It would help to see full set of headers (you can use LiveHTTPHeaders
> or Firebug extesnions for that), but I have a wild idea: can you try
> to rename your swf from
> hello.lzx.swf  to, say hello-lzx.swf maybe something along the path thinks that
> lzx is extension of the file, not .swf....

Renaming the file worked. I also cleared the browser's cache and the
original file name works as well.

Thanks for the response.
This topic is locked and can not be replied to.