# VCard Upload Import

**URL:** <https://www.ruby-forum.com/t/vcard-upload-import/95103>\
**Category:** Rails\
**Created:** [January 12, 2006, 11:50pm UTC](https://www.ruby-forum.com/t/vcard-upload-import/95103 "2006-01-12T23:50:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [January 12, 2006, 11:50pm UTC](https://www.ruby-forum.com/t/vcard-upload-import/95103/1 "2006-01-12T23:50:32Z")

</div>

I’m trying to add Vcard import functionality and I keep getting the  
following using the code provided below. I’m using the VPIM library  
to decode the vcards and add them to my database table. Can someone  
help me out, or point me in a different direction for importing  
VCards. Thanks.

Error:  
cannot convert StringIO into String

Controller Code:  
require ‘vpim/vcard’

if request.post? and params[:import\_file]  
cards = Vpim::Vcard.decode(File.open(params[:import\_file]))  
end
