|
Re: Mason component to output image: msg#00171web.mason.user
On 22 Jul 2003 at 2:43, Adam Roth wrote: > > I want a mason component to output a jpeg. This is what i've tried: > in httpd.conf: > > AddType image/jpeg .mjpg All this does (AFAIK) is tells Apache to send a content-type: image/jpeg header along with any files with the .mjpg extension. What you need to do is configure Mason to serve .mjpg files just as you configure it to serve .html or .mhtml files. Then in your component, call $r->content_type('image/jpeg') before sending the file. > > in test.mjpg > <%perl> > > open(FILE,"/robot.jpg"); > while(<FILE>){ > print $_; > } > close FILE; > </%perl> > > Running the component just spits back the code within test.mjpg. > > > > Any ideas? > Adam -- Dr. David R. Baird ZeroFive Web Design dave@xxxxxxxxxxxxxx http://www.zerofive.co.uk ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Mason component to output image: 00171, Adam Roth |
|---|---|
| Next by Date: | e-smith / SME: 00171, Kees Vonk |
| Previous by Thread: | Mason component to output imagei: 00171, Adam Roth |
| Next by Thread: | Re: Mason component to output image: 00171, John Williams |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |