Carrier Wave not completing upload to Rackspace Cloud Files
- by Zack Fernandes
Hello, I have been attempting to get file uploads to Rackspace Cloud Files online all night, and finally tried the Carrierwave Plugin. Although the plugin worked right away, when I tried viewing the file uploaded (an image) it was broken. Upon further testing, I found out that files would upload to Cloud Files, however were just a fraction of their original size.
I can't seem to figure out what's worng, and any help would be greatly appreciated. My code is as follows.
models\attachment.rb
class Attachment < ActiveRecord::Base
attr_accessible :title, :user_id, :file, :remote_file_url, :file_cache, :remove_file
belongs_to :user
mount_uploader :file, AttachmentUploader
end
uploaders\attachment_uploader.rb
class AttachmentUploader < CarrierWave::Uploader::Base
storage :cloud_files
def store_dir
"#{model.user_id}-#{model.id}"
end
end