Attachment_fu file upload from local files

If you need to batch import files into attachment_fu from a local source then you can doing the following

l = Logo.new(:uploaded_data => ActionController::TestUploadedFile.new(“/home/jordan/Documents/test_project/1.jpg”, “image/jpeg”))

You can encapsulate that in a loop and iterate over a list of files if need be (would be assumed for batch import eh.)  Enjoy!

Posted on September 24, 2009 at 8:34 pm by Jordan Carter · Permalink
In: Uncategorized · Tagged with: , ,

One Response

  1. Written by David Furber
    on December 24, 2009 at 4:25 pm
    Permalink

    Don’t forgot:
    require ‘action_controller/test_process.rb’

Leave a Reply