title: Carrierwave Programatic Upload
body: <p>Right now in my rails app I'm using Carrierwave to upload files to Amazon S3. I'm using a file selector and a form to select and submit the file, this works well. </p>
  
  <p>However, I'm now trying to make posts from an iPhone app and am receiving the contents of the file. I'd like to create a file using this data and then upload it using Carrierwave so that I can get the correct path back. </p>
  
  <p>May file model consists of: </p>
  
  <pre><code>path
  file_name
  id
  user_id
  </code></pre>
  
  <p>where path is the Amazon S3 url. I'd like to do something like this to build the files:</p>
  
  <pre><code> data = params[:data]
  ~file creation magic using data~
  ~carrierwave upload magic using file~
  @user_id = params[:id]
  @file_name = params[:name]
  @path = path_provided_by_carrierwave_magic
  File.build(@user_id, @file_name, @path)
  </code></pre>
  
  <p>Would really love someone to point me in the right direction. Thanks!</p>