Hello, On the project I''m working on at the moment, I need (unavoidably) to embed a swf file within the main page. I''ve tried simply placing the swf in a directory ''flash'' under public and then using ''/flash/myswf.swf'' as the movie value in the object/ embed tags, but this doesn''t work. I''ve also read about the controller methods send_data and send_file, but from my understanding I would only use these if I wanted to display the swf and the swf only in the browser, rather than including it among other content. Has anyone had any success with this? It seems like something that *should* be simple to do, but I''m having trouble figuring it out. The preferred approach would be to not use Flash at all, but unfortunately I can''t do that in this case. Many thanks, Matt
>From public/.htaccess:# If you don''t want Rails to look in certain directories, # use the following rewrite rules so that Apache won''t rewrite certain requests # # Example: # RewriteCond %{REQUEST_URI} ^/notrails.* # RewriteRule .* - [L] Thusly, if you put: RewriteCond %{REQUEST_URI} ^/flash.* RewriteRule .* - [L] in your public/.htaccess, it should work. If you don''t do that, any request to that directory is being routed to Rails instead of to the actual files. On 6/30/05, Matt <listaction-FXsoPwVLZSKdyyGsB3R/UQ@public.gmane.org> wrote:> Hello, > > On the project I''m working on at the moment, I need (unavoidably) to > embed a swf file within the main page. > > I''ve tried simply placing the swf in a directory ''flash'' under public > and then using ''/flash/myswf.swf'' as the movie value in the object/ > embed tags, but this doesn''t work. > > I''ve also read about the controller methods send_data and send_file, > but from my understanding I would only use these if I wanted to > display the swf and the swf only in the browser, rather than > including it among other content. > > Has anyone had any success with this? It seems like something that > *should* be simple to do, but I''m having trouble figuring it out. The > preferred approach would be to not use Flash at all, but > unfortunately I can''t do that in this case. > > Many thanks, > > Matt > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Chris Johnson cj-lHH7W0eyjmpWk0Htik3J/w@public.gmane.org
Thanks Chris, hard to believe I missed that, having already read the .htaccess! It also transpired I had a configuration conflict having previously set up jrun for apache. A combination of the .htaccess rule and removing the .swf handler from mod_jrun in the httpd.conf solved the issue. Cheers Matt On 30 Jun 2005, at 19:10, Chris Johnson wrote:>> From public/.htaccess: >> > > # If you don''t want Rails to look in certain directories, > # use the following rewrite rules so that Apache won''t rewrite > certain requests > # > # Example: > # RewriteCond %{REQUEST_URI} ^/notrails.* > # RewriteRule .* - [L] > > Thusly, if you put: > > RewriteCond %{REQUEST_URI} ^/flash.* > RewriteRule .* - [L] > > in your public/.htaccess, it should work. If you don''t do that, any > request to that directory is being routed to Rails instead of to the > actual files. > > On 6/30/05, Matt <listaction-FXsoPwVLZSKdyyGsB3R/UQ@public.gmane.org> wrote: > >> Hello, >> >> On the project I''m working on at the moment, I need (unavoidably) to >> embed a swf file within the main page. >> >> I''ve tried simply placing the swf in a directory ''flash'' under public >> and then using ''/flash/myswf.swf'' as the movie value in the object/ >> embed tags, but this doesn''t work. >> >> I''ve also read about the controller methods send_data and send_file, >> but from my understanding I would only use these if I wanted to >> display the swf and the swf only in the browser, rather than >> including it among other content. >> >> Has anyone had any success with this? It seems like something that >> *should* be simple to do, but I''m having trouble figuring it out. The >> preferred approach would be to not use Flash at all, but >> unfortunately I can''t do that in this case. >> >> Many thanks, >> >> Matt >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > > -- > Chris Johnson > cj-lHH7W0eyjmpWk0Htik3J/w@public.gmane.org > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >