Depending on browser, user settings and response headers, one of three things can happen: The browser shows a "Save. I am using Carrierwave to upload text files to Rackspace, and have this working.
My setup is really standard: Uploader: Model: Carrierwave init file. Download any ePaper PDF instantly for free in the bltadwin. Before we remove CarrierWave, we need to store references to the files from CarrierWave. Since configurations differ greatly, we should probably just create a quick CSV reference.
Although there are some gems for this purpose, let's just build a quick solution using rake tasks. Turned on by default. Validates that the remote net url is valid. As well as the built in validations CarrierWaveDirect provides, some validations, such as max file size and upload expiration can be performed on the S3 side.
If you are using a javascript uploader e. Dropzone, jQuery Upload, Uploadify, etc. To do that open your bucket in Amazon console, click on its properties and add a CORS configuration similar to this. When you use this gem in conjunction with CloudFront you'll need an additional step otherwise it won't work as expected. Here is a step by step walkthrough that explain this setup. It also explain CORS configuration. CarrierWaveDirect provides a couple of helpers to help with integration and unit testing.
You don't want to contact the Internet during your tests as this is slow, expensive and unreliable. You should first put fog into mock mode by doing something like this. To get the Capybara helpers, include the module into your test file or helper. The Active Record validations use the Rails i18n framework. Add these keys to your translations file:. If you're Rails app was newly generated after version 3. You can fix this by setting config. Pull requests are very welcome. Before submitting a pull request, please make sure that your changes are well tested.
Pull requests without tests will not be accepted. After you have fixed a bug or added a feature please also use the CarrierWaveDirect Sample Application to ensure that the gem still works correctly. Thank you to everybody who has contributed to CarrierWaveDirect. A special thanks to nddeluca Nicholas DeLuca who does a great job maintaining this gem.
If you'd like to help him out see Skip to content. Configure and use it just like you would Fog. If you are using a non-standard endpoint for S3 service eg: Swiss-based Exoscale S3 you can override it like this. If you have a custom uploader that specifies additional headers for each URL, please try the following example:. The policy for the role will look something like this:. If you migrate from fog your uploader may be configured as storage :fog , simply comment out that line, as in the following example, or remove that specific line.
With carrierwave-aws the query part becomes obsolete, just use a hash of headers. Please read [usage][ Usage] for a more detailed explanation about configuration. In order to run the integration specs you will need to configure some environment variables. A sample file is provided as.
0コメント