title: Reading and writing file attributes
body: <p>In the rails console:</p>
  
  <pre><code>ActionDispatch::Http::UploadedFile.new tempfile: 'tempfilefoo', original_filename: 'filename_foo.jpg', content_type: 'content_type_foo', headers: 'headers_foo'
   =&gt; #&lt;ActionDispatch::Http::UploadedFile:0x0000000548f3a0 @tempfile="tempfilefoo", @original_filename=nil, @content_type=nil, @headers=nil&gt; 
  </code></pre>
  
  <p>I can write a string to <code>@tempfile</code>, and yet <code>@original_filename</code>, <code>@content_type</code> and <code>@headers</code> remain as <code>nil</code></p>
  
  <p>Why is this and how can I write information to these attributes?</p>
  
  <p>And how can I <em>read</em> these attributes from a file instance? </p>
  
  <p>i.e.</p>
  
  <pre><code>File.new('path/to/file.png')
  </code></pre>