https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292012-05-04T17:11:24ZRedmineRedmine - Defect #10832: REST Uploads fail with fastcgihttps://www.redmine.org/issues/10832?journal_id=379452012-05-04T17:11:24ZJeffrey Clark
<ul></ul><p>Webrick appears to work fine. Perhaps a problem related to fastcgi.</p> Redmine - Defect #10832: REST Uploads fail with fastcgihttps://www.redmine.org/issues/10832?journal_id=379462012-05-04T17:50:53ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Target version</strong> set to <i>1.4.2</i></li></ul><p>I'm able to reproduce with apache+fastcgi.</p> Redmine - Defect #10832: REST Uploads fail with fastcgihttps://www.redmine.org/issues/10832?journal_id=379482012-05-04T18:49:33ZJeffrey Clark
<ul><li><strong>File</strong> <a href="/attachments/7567">rest-upload-fastcgi.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/7567/rest-upload-fastcgi.patch">rest-upload-fastcgi.patch</a> added</li></ul><p>Unfortunately the various Rack::Handler's don't handle input all the same way :(</p> Redmine - Defect #10832: REST Uploads fail with fastcgihttps://www.redmine.org/issues/10832?journal_id=379492012-05-04T19:06:29ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Or maybe (untested):</p>
<pre>
Index: app/controllers/attachments_controller.rb
===================================================================
--- app/controllers/attachments_controller.rb (revision 9616)
+++ app/controllers/attachments_controller.rb (working copy)
@@ -67,7 +67,7 @@
return
end
- @attachment = Attachment.new(:file => request.body)
+ @attachment = Attachment.new(:file => request.raw_post)
@attachment.author = User.current
@attachment.filename = Redmine::Utils.random_hex(16)
</pre> Redmine - Defect #10832: REST Uploads fail with fastcgihttps://www.redmine.org/issues/10832?journal_id=379522012-05-04T20:23:52ZJeffrey Clark
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>Or maybe (untested):</p>
</blockquote>
<p>Nope :(</p>
<pre>
NoMethodError (undefined method `read' for #<String:0x7f191b1fbae0>):
app/models/attachment.rb:114:in `files_to_final_location'
app/models/attachment.rb:112:in `open'
app/models/attachment.rb:112:in `files_to_final_location'
app/controllers/attachments_controller.rb:74:in `upload'
dispatch.fcgi:27
</pre> Redmine - Defect #10832: REST Uploads fail with fastcgihttps://www.redmine.org/issues/10832?journal_id=379572012-05-05T09:23:39ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Jeffrey Clark wrote:</p>
<blockquote>
<p>Nope :(</p>
</blockquote>
<p>The patch should work after <a class="changeset" title="Use Mail instead of TMail in MailHandler." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/9630">r9630</a>.</p> Redmine - Defect #10832: REST Uploads fail with fastcgihttps://www.redmine.org/issues/10832?journal_id=379592012-05-05T09:45:52ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Subject</strong> changed from <i>REST Uploads fail</i> to <i>REST Uploads fail with fastcgi</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li></ul> Redmine - Defect #10832: REST Uploads fail with fastcgihttps://www.redmine.org/issues/10832?journal_id=380002012-05-08T10:47:10ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Fixed in 1.4-stable (<a class="changeset" title="Fixed that REST Uploads fail with fastcgi in 1.4-stable (#10832)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/9653">r9653</a>) and trunk (<a class="changeset" title="Fixed that REST Uploads fail with fastcgi (#10832)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/9652">r9652</a>). Tested with apache2+fcgid.</p>