# Serving Up Images Rather Than Webpages

**URL:** <https://www.ruby-forum.com/t/serving-up-images-rather-than-webpages/141842>\
**Category:** Rails\
**Created:** [July 1, 2008, 12:20am UTC](https://www.ruby-forum.com/t/serving-up-images-rather-than-webpages/141842 "2008-07-01T00:20:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lastps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a5b964/32.png) [@lastps](https://www.ruby-forum.com/u/lastps)\
**Post date:** [July 1, 2008, 12:20am UTC](https://www.ruby-forum.com/t/serving-up-images-rather-than-webpages/141842/1 "2008-07-01T00:20:22Z")

</div>

Paypal allows me to upload an image to customize their payment page.  
It’s looking for something like:  
[http://mysite.com/my\_image.gif](http://mysite.com/my_image.gif)

How do I get rails to serve up an image when paypal goes to this  
address?

I made a route to a controller/action using the url but how do I then  
serve up an image rather than a webpage?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![lastps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a5b964/32.png) [@lastps](https://www.ruby-forum.com/u/lastps)\
**Post date:** [July 1, 2008, 12:26am UTC](https://www.ruby-forum.com/t/serving-up-images-rather-than-webpages/141842/2 "2008-07-01T00:26:49Z")

</div>

> Paypal allows me to upload an image to customize their payment page.  
> It’s looking for something like:  
> [http://mysite.com/my\_image.gif](http://mysite.com/my_image.gif)
> 
> How do I get rails to serve up an image when paypal goes to this  
> address?
> 
> I made a route to a controller/action using the url but how do I then  
> serve up an image rather than a webpage?

Change the returned content-type and then send the raw image data.

But unless your image changes, why not just make it static and drop it  
in public?

---

<div class="post-metadata">

**Author:** ![lastps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a5b964/32.png) [@lastps](https://www.ruby-forum.com/u/lastps)\
**Post date:** [July 1, 2008, 4:50pm UTC](https://www.ruby-forum.com/t/serving-up-images-rather-than-webpages/141842/3 "2008-07-01T16:50:14Z")

</div>

Look up send\_data()
