title: Amazon S3 only accepting files with no spaces, no numbers in the title?
body: <p>This is an odd question, but only commensurate with the strange behavior I'm seeing. My app is  Rails 3/Paperclip/S3.</p>
  <p>Symptoms:</p>
  <ul>
  <li>All images are uploading regardless of their title.</li>
  <li>When uploading a .pdf or .doc, if the title has no spaces like my_doc.pdf, it uploads fine.</li>
  <li>When uploading a .pdf or .doc with spaces, such as My Doc.pdf, it fails, either with error <code>broken pipe</code> or by the file silently failing to upload to S3.</li>
  <li>When uploading a .pdf or .doc with numbers, such as mydoc20.pdf, it also fails as above.</li>
  </ul>
  <p>I imagine there are two possible solutions to this problem.</p>
  <ol>
  <li>Fix the <code>broken pipe</code> error directly (preferred method).</li>
  <li>Automatically rename every uploaded file to remove spaces and numbers before it is saved to S3 - while not fixing it at the source, I imagine this would allay the issue.</li>
  </ol>
  <p>I would greatly appreciate any help you can give me in fixing 1 and/or 2.</p>
  <hr />
  <h2>Code</h2>
  <pre><code># Upload.rb model
  class Upload &lt; ActiveRecord::Base
    has_attached_file :document,
      :storage =&gt; :s3,
      :s3_credentials =&gt; &quot;#{::Rails.root.to_s}/config/s3.yml&quot;,
      :path =&gt; &quot;/docs/:style/:id/:basename.:extension&quot;
    has_attached_file :photo,
      :styles =&gt; {:medium =&gt; &quot;200x300&gt;&quot;, :thumb =&gt; &quot;100x150&gt;&quot; },
      :storage =&gt; :s3,
      :s3_credentials =&gt; &quot;#{::Rails.root.to_s}/config/s3.yml&quot;,
      :path =&gt; &quot;/photos/:style/:id/:basename.:extension&quot;
  
  # s3.yml
  development:
    bucket: dev_bucket_name
    access_key_id: dev_acc_key
    secret_access_key: dev_sec_key
  production:
    bucket: my_production_bucket
    access_key_id: my_access_key_id
    secret_access_key: my_secret_key
  
  # environment.rb is empty with regard to uploading.
  
  # uploads_controller.rb
  def edit
    @candidate = Candidate.find(current_user.user_type_id)
    render :layout =&gt; 'forms'
  end
  
  def update
    @candidate = Candidate.find(params[:id])
    if @candidate.update_attributes(params[:candidate])
      flash[:notice] = &quot;Profile updated successfully.&quot;
      redirect_to :action =&gt; &quot;show&quot;, :id =&gt; params[:id]
    else
      flash[:notice] = &quot;There was an error updating your profile.&quot;
      render :action =&gt; &quot;edit&quot;, :id =&gt; params[:id]
    end
  end
  </code></pre>
  <p>I don't believe there are any methods involved. I almost hope there is something obviously wrong with my approach because that means it'll get fixed :).</p>