search for: import_file

Displaying 6 results from an estimated 6 matches for "import_file".

2006 Jan 12
3
VCard Upload Import
...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
2006 Feb 20
1
Upload Text File into a string
I''m trying to upload a text file from a form and read the file into a string in my rails app. I''ve tried using @import_file = File.read(params[:import_file]) as well as File.open, but I need getting "cannot convert StringIO into String" errors. Anyone have any ideas? - Kyle -- Posted via http://www.ruby-forum.com/.
2010 Jan 22
0
Routing/File Upload/Put vs. Post puzzle
...some code that will process it. It is not getting stored. The UI is a "maintain" page with a file entry field in a form, and a button to import the file and some other maintenance tasks which are not relevant right now. Here are snippets: routes.rb: map.maintain ''/maintain/import_file'', :controller => ''maintain'', :action => ''import_file'', :conditions => { :method => :put } map.maintain ''/maintain/export_file'', :controller => ''maintain'', :action => ''export_file'',...
2006 Dec 18
3
Creating another database connection for large mysql import?
I''m using backgroundrb to periodically download a large file via ftp from a remote location and then import it into the database. To perform the import, I was using the following: ActiveRecord::Base.connection.execute(%{load data infile ...;}) although on a file with 2.5 million records, this can take 5 minutes, which seems to tie up my rails application while this executes (even
2012 May 25
4
Reading a bunch of csv files into R
Dear R users I am struggling from a data importing issue: I have some hundreds of csv files needed to be read into R for futher analysis. All those csv files are named in one of the three formats: (1) strings: e.g. London_Oxford street (2) Integer: e.g. 1234_5678 (3) combined: e.g. London_1234 I intend to use read.csv("xxxx_xxx.csv") but I only dealt with sigle documents before and
2007 Jul 04
2
content_type from a local file?
I''m using a Rake task to add local files into a database designed for use with attachment_fu. http://eldorado.googlecode.com/svn/trunk/db/migrate/039_create_avatars.rb http://eldorado.googlecode.com/svn/trunk/lib/tasks/import_files.rake So, attachment_fu has a "content_type" field, which apparently is receiving that information from the browser...? I''m trying to figure out if there is a way to get the content_type of a file (e.g. ''image/png'') that you''ve already got in your fil...