Carrier Wave not completing upload to Rackspace Cloud Files
Posted
by Zack Fernandes
on Stack Overflow
See other posts from Stack Overflow
or by Zack Fernandes
Published on 2010-06-12T08:20:35Z
Indexed on
2010/06/12
8:22 UTC
Read the original article
Hit count: 379
ruby-on-rails
|rackspace-cloud
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
© Stack Overflow or respective owner