# Add image to CSV file

**URL:** <https://www.ruby-forum.com/t/add-image-to-csv-file/119949>\
**Category:** Rails\
**Created:** [November 12, 2007, 2:47pm UTC](https://www.ruby-forum.com/t/add-image-to-csv-file/119949 "2007-11-12T14:47:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [November 12, 2007, 2:47pm UTC](https://www.ruby-forum.com/t/add-image-to-csv-file/119949/1 "2007-11-12T14:47:30Z")

</div>

I am trying to generate a report from my rails app which needs a photo  
displayed for each record. This anyone know what the best way is to do  
this or if it is possible?

Ive searched the forums and the net but cant find any examples,

Johnny B

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [November 12, 2007, 3:02pm UTC](https://www.ruby-forum.com/t/add-image-to-csv-file/119949/2 "2007-11-12T15:02:28Z")

</div>

So you’re wanting to add binary data to a plain text CSV file?

I don’t think that’s possible as-is, since CSV is meant for text  
storage, and not binary/blob stuff.

What you can do, is put a filesystem path into the csv and use that  
wherever you’re parsing the CSV.

El lun, 12-11-2007 a las 14:47 +0100, John B.  
escribió:\> I am trying to generate a report from my rails app which needs a photo

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [November 12, 2007, 3:30pm UTC](https://www.ruby-forum.com/t/add-image-to-csv-file/119949/3 "2007-11-12T15:30:12Z")

</div>

I though so, basically i need to generate a spreadsheet that will  
contain records from a model and the appropriate photo embedded into the  
spreadsheet for each record.

This spreadsheet will be ultimately opened by the user in MS excel.

Whats the best solution for this, Is there any ruby libraries that will  
do this?

Any advice appreciated,

Johnny B
