{"repo":"y9v/carrierwave-base64","free":true,"listed":false,"github":"https://github.com/y9v/carrierwave-base64","clone":"git clone https://github.com/y9v/carrierwave-base64.git","description":"Upload files encoded as base64 strings directly to carrierwave","language":"Ruby","stars":266,"topics":["carrierwave","ruby","file-uploads","api"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Carrierwave::Base64 Upload files encoded as base64 to carrierwave. This small gem can be useful for API's that interact with mobile devices. This gem requires Ruby 2.0 or higher. Installation Add the gem to your Gemfile: Also add this if you need mongoid support: Usage Mount the uploader to your model: Now you can also upload files by passing an encoded base64 string to the attribute. This also works for normal file uploads from file fields inside an HTML form, so you can safely replace mount uploader with mount base64 uploader to support both file input and base64 encoded input Upload file extension The file extension for the uploaded base64 string is identified automatically using the mime-types gem and content type from the uploaded string. If the required MIME type is not registered, you can add it, using MIME::Types#add: Setting the file name You can set the file name option to a lambda, that will return a filename without an extension, using the model instance: If you still want to set the filename to a fixed string, wrap it in a Proc: Data format File extention for the uploaded file is identified automatically based on the file contents. If it can't be identified automaticaly, it falls back to the content-type, specified in the data string. Contributing 1. Fork it ( https://github.com/[my-github-username]/carrierwave-base64/fork ) 2. Create your feature branch ( git checkout -b my-new-feature ) 3. Commit your changes ( git commit -am 'Add some feature' ) 4. Push to the","default_branch":null,"files":null,"tree":[],"storefront":"/r/y9v","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/y9v/carrierwave-base64/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}