# Calling Image File

**URL:** <https://www.ruby-forum.com/t/calling-image-file/100723>\
**Category:** Rails\
**Created:** [July 31, 2006, 6:22pm UTC](https://www.ruby-forum.com/t/calling-image-file/100723 "2006-07-31T18:22:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stylizedgeek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@stylizedgeek](https://www.ruby-forum.com/u/stylizedgeek)\
**Post date:** [July 31, 2006, 6:22pm UTC](https://www.ruby-forum.com/t/calling-image-file/100723/1 "2006-07-31T18:22:18Z")

</div>

I’ve this small test app where I’m saving a user profile picture in a  
subdirectory under “public” folder. Now when a user uploads a picture -  
a unique directory is created under his id and then his/her image is  
stored there. Now while retrieving the image I only get the path name  
and nothing else. How can I get the image shown in the browser…HELP  
PLEASE!!!

---

<div class="post-metadata">

**Author:** ![stylizedgeek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@stylizedgeek](https://www.ruby-forum.com/u/stylizedgeek)\
**Post date:** [July 31, 2006, 6:29pm UTC](https://www.ruby-forum.com/t/calling-image-file/100723/2 "2006-07-31T18:29:53Z")

</div>

On Jul 31, 2006, at 12:22 PM, Mister Stylizedgeek wrote:

> I’ve this small test app where I’m saving a user profile picture in a  
> subdirectory under “public” folder. Now when a user uploads a  
> picture -  
> a unique directory is created under his id and then his/her image is  
> stored there. Now while retrieving the image I only get the path name  
> and nothing else. How can I get the image shown in the browser…HELP  
> PLEASE!!!

No need to shout. Have you first checked that the image is getting  
stored properly? Then check to see if you can browse straight to the  
image in your web browser.

If both those work then you probably have an error in your image tag  
in your view.  
-Mat

---

<div class="post-metadata">

**Author:** ![stylizedgeek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@stylizedgeek](https://www.ruby-forum.com/u/stylizedgeek)\
**Post date:** [July 31, 2006, 6:45pm UTC](https://www.ruby-forum.com/t/calling-image-file/100723/3 "2006-07-31T18:45:39Z")

</div>

Mat S. wrote:

> On Jul 31, 2006, at 12:22 PM, Mister Stylizedgeek wrote:
> 
> > I’ve this small test app where I’m saving a user profile picture in a  
> > subdirectory under “public” folder. Now when a user uploads a  
> > picture -  
> > a unique directory is created under his id and then his/her image is  
> > stored there. Now while retrieving the image I only get the path name  
> > and nothing else. How can I get the image shown in the browser…HELP  
> > PLEASE!!!
> 
> No need to shout. Have you first checked that the image is getting  
> stored properly? Then check to see if you can browse straight to the  
> image in your web browser.
> 
> If both those work then you probably have an error in your image tag  
> in your view.  
> -Mat

I already checked, everything displays in the browser correctly when  
called direct. And as an FYI, I’m not SHOUTING!

---

<div class="post-metadata">

**Author:** ![stylizedgeek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@stylizedgeek](https://www.ruby-forum.com/u/stylizedgeek)\
**Post date:** [July 31, 2006, 7:51pm UTC](https://www.ruby-forum.com/t/calling-image-file/100723/4 "2006-07-31T19:51:00Z")

</div>

On Jul 31, 2006, at 12:45 PM, Mister Stylizedgeek wrote:

> > > and nothing else. How can I get the image shown in the
> 
> I already checked, everything displays in the browser correctly when  
> called direct. And as an FYI, I’m not SHOUTING!

Dude, you like, totally were. There were even bangs involved. 🙂

Anyway. Do view source on the HTML, the path to the file is probably  
wrong or the tag is malformed Are doing this under apache by any  
chance? I’ve had trouble with the “public” directory being in the  
wrong place when using apache previously.  
-Mat
