# Problem while adding cgi.img

**URL:** <https://rubytalk.org/t/problem-while-adding-cgi-img/54643>\
**Category:** ruby-talk\
**Created:** [28 July 2009 07:44 UTC](https://rubytalk.org/t/problem-while-adding-cgi-img/54643 "2009-07-28T07:44:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asaf\_Dasa](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@Asaf\_Dasa](https://rubytalk.org/u/Asaf_Dasa)\
**Post date:** [28 July 2009 07:44 UTC](https://rubytalk.org/t/problem-while-adding-cgi-img/54643/1 "2009-07-28T07:44:43Z")

</div>

Hi,

I tried to insert an img file to my cgi script, but I had some problems.  
when i run the tmp.rb file that I create on the server, I can't see this  
img. when I trying to run the generated html (using this script) on a  
front-page or even on a regular browser I can see that the format that I  
used is ok and I an see the image exactly where I placed it.  
Can you please help me understand what is the problem using the img on  
the server, and how to solve it, its realy importent ...

Thanks,  
Asaf

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![7stud](https://avatars.discourse-cdn.com/v4/letter/7/57b2e6/32.png) [@7stud](https://rubytalk.org/u/7stud)\
**Post date:** [28 July 2009 08:28 UTC](https://rubytalk.org/t/problem-while-adding-cgi-img/54643/2 "2009-07-28T08:28:30Z")

</div>

Asaf Dasa wrote:

> Hi,
> 
> I tried to insert an img file to my cgi script, but I had some problems.  
> when i run the tmp.rb file that I create on the server, I can't see this  
> img. when I trying to run the generated html (using this script) on a  
> front-page or even on a regular browser I can see that the format that I  
> used is ok and I an see the image exactly where I placed it.  
> Can you please help me understand what is the problem using the img on  
> the server, and how to solve it, its realy importent ...
> 
> Thanks,  
> Asaf

In what directory is your image? And what path do you use for the image  
in your ruby program?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Asaf\_Dasa](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@Asaf\_Dasa](https://rubytalk.org/u/Asaf_Dasa)\
**Post date:** [28 July 2009 10:08 UTC](https://rubytalk.org/t/problem-while-adding-cgi-img/54643/3 "2009-07-28T10:08:35Z")

</div>

7stud -- wrote:

> Asaf Dasa wrote:
> 
> > Hi,
> > 
> > I tried to insert an img file to my cgi script, but I had some problems.  
> > when i run the tmp.rb file that I create on the server, I can't see this  
> > img. when I trying to run the generated html (using this script) on a  
> > front-page or even on a regular browser I can see that the format that I  
> > used is ok and I an see the image exactly where I placed it.  
> > Can you please help me understand what is the problem using the img on  
> > the server, and how to solve it, its realy importent ...
> > 
> > Thanks,  
> > Asaf
> 
> In what directory is your image? And what path do you use for the image  
> in your ruby program?

the img is in the directory where tmp.rb is and I use the following code  
:

...  
cgi.img("border" =\> "0","src" =\> "icon.jpg","alt" =\> "my icon", "type"  
=\> "JPEG Image", "width" =\> "600", "height" =\> "200")  
...

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
