How to use paperclip with a file already on my server?
For the record, I'm working on legacy code and I'm trying to plug a new feature without breaking everything. Right now I have a bunch of files on my server as such:

     myapp/public/temp/myfile.doc

The thing is that I want to create a Docfile object from these files in a controller action.

Here is the trimmed down Docfile class:

    class DocFile < ActiveRecord::Base
      has_attached_file :docs,
        :path => "#{Constants::DOCFILES_PATH}:basename.:extension",
        :url => "http://#{Constants::SITE_URL}/docs/:basename.:extension"
    end

Paperclip has some nice documentation if you upload from a form, but not in my situation.

So how can I "simulate" the fact that I'm uploading a file?

So far I've tried this:

    temp_file_url = "correct_rails_root/myapp/public/temp/myfile.doc"
    @docfile = DocFile.new :docs => temp_file

But it's not working.

Any pointers would be appreciated!
How to use paperclip with a file already on my server?
===

For the record, I'm working on legacy code and I'm trying to plug a new feature without breaking everything. Right now I have a bunch of files on my server as such:

     myapp/public/temp/myfile.doc

The thing is that I want to create a Docfile object from these files in a controller action.

Here is the trimmed down Docfile class:

    class DocFile < ActiveRecord::Base
      has_attached_file :docs,
        :path => "#{Constants::DOCFILES_PATH}:basename.:extension",
        :url => "http://#{Constants::SITE_URL}/docs/:basename.:extension"
    end

Paperclip has some nice documentation if you upload from a form, but not in my situation.

So how can I "simulate" the fact that I'm uploading a file?

So far I've tried this:

    temp_file_url = "correct_rails_root/myapp/public/temp/myfile.doc"
    @docfile = DocFile.new :docs => temp_file

But it's not working.

Any pointers would be appreciated!