# Suggestion for how to batch add records & photos

**URL:** <https://www.ruby-forum.com/t/suggestion-for-how-to-batch-add-records-photos/177105>\
**Category:** Rails\
**Created:** [October 11, 2009, 9:51pm UTC](https://www.ruby-forum.com/t/suggestion-for-how-to-batch-add-records-photos/177105 "2009-10-11T21:51:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![northband](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ecae2f/32.png) [@northband](https://www.ruby-forum.com/u/northband)\
**Post date:** [October 11, 2009, 9:51pm UTC](https://www.ruby-forum.com/t/suggestion-for-how-to-batch-add-records-photos/177105/1 "2009-10-11T21:51:27Z")

</div>

Hi -

I’m about to embark on a project where a client will upload a csv file  
of records (anywhere from 10-1000). Each record can have one or  
multiple files. I am reaching out to the community for some ideas on  
how to approach this.

I’m wondering if I should have an ftp portion - where they ftp the  
files to a directory. Then have the app look in the directory and  
match according to csv records, iterate and upload/attach them. Also  
if I can’t support multiple files per record - that’s fine - one will  
have to do.

Any tips or suggestions out there?

-Adam O

---

<div class="post-metadata">

**Author:** ![northband](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ecae2f/32.png) [@northband](https://www.ruby-forum.com/u/northband)\
**Post date:** [October 11, 2009, 9:53pm UTC](https://www.ruby-forum.com/t/suggestion-for-how-to-batch-add-records-photos/177105/2 "2009-10-11T21:53:20Z")

</div>

northband wrote:

> Hi -
> 
> I’m about to embark on a project where a client will upload a csv file  
> of records (anywhere from 10-1000). Each record can have one or  
> multiple files. I am reaching out to the community for some ideas on  
> how to approach this.
> 
> I’m wondering if I should have an ftp portion - where they ftp the  
> files to a directory. Then have the app look in the directory and  
> match according to csv records, iterate and upload/attach them. Also  
> if I can’t support multiple files per record - that’s fine - one will  
> have to do.
> 
> Any tips or suggestions out there?

You already seem to know how to do this, unles I grossly misunderstand.  
What exactly are you asking for help on?

> -Adam O

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![northband](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ecae2f/32.png) [@northband](https://www.ruby-forum.com/u/northband)\
**Post date:** [October 12, 2009, 1:00am UTC](https://www.ruby-forum.com/t/suggestion-for-how-to-batch-add-records-photos/177105/3 "2009-10-12T01:00:32Z")

</div>

I’m basically looking for a general consensus that this is a feasible  
approach - before diving in and realizing that its ‘doomed’. I’ll  
start this direction and see how it goes.

Thanks!

On Oct 11, 3:53 pm, Marnen Laibow-Koser \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![northband](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ecae2f/32.png) [@northband](https://www.ruby-forum.com/u/northband)\
**Post date:** [October 12, 2009, 4:58pm UTC](https://www.ruby-forum.com/t/suggestion-for-how-to-batch-add-records-photos/177105/4 "2009-10-12T16:58:49Z")

</div>

Parsing a CSV is certainly possible and very easy. I use FasterCSV

If your client FTP’s the file, then you will need to somehow know that  
happened so you can parse it. Or if you provide file upload  
functionality, then you can parse it at the time of upload.
