Macrow / rails_kindeditor

Kindeditor for Ruby on Rails
260 stars 108 forks source link

上传图片传入阿里云oss #97

Open huzhijia opened 6 years ago

huzhijia commented 6 years ago

上传图片,想存入阿里云oss中。 我在railskindeditor.rb中配置了静态源地址, 为什么图片存储的位置还是本地。 除了编辑器里面的图片,其它上传的图片都可以正常存入到阿里云oss中 --------------rails_kindeditor.rb配置----------------------- RailsKindeditor.setup do |config|

config.upload_dir = 'uploads/product/'

config.upload_image_ext = %w[gif jpg jpeg png bmp] config.upload_flash_ext = %w[swf flv] config.upload_media_ext = %w[swf flv mp3 wav wma wmv mid avi mpg asf rm rmvb] config.upload_file_ext = %w[doc docx xls xlsx ppt htm html txt zip rar gz bz2]

config.asset_url_prefix = "http:/XXX.com/"

end

----------------carrierwave.rb配置------------------------- CarrierWave.configure do |config| config.storage = :aliyun config.aliyun_access_id = "XXXX" config.aliyun_access_key = 'XXXXX' config.aliyun_bucket = "huilizhi" config.aliyun_internal = false config.aliyun_area = "cn-beijing" config.aliyun_host = "http://XXXXX.com" config.aliyun_private_read = true end

Macrow commented 6 years ago

具体没测试过上传到云,上传也都是调用的carrierwave,你再看看log,分析一下?