Defect #3911

Uploading attachment of a document fails with JRuby

Added by Babar O'Cap about 10 years ago. Updated about 8 years ago.

Status:ClosedStart date:2009-09-23
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Attachments
Target version:-
Resolution:Wont fix Affected version:

Description

If the file is above 25 Kb, the attachment isn't create.
I think that this bug is due to Rails who uses ActionController::UploadedStringIO for uploading files with little size and ActionController::UploadedTempfile for bigger files (
read this article for more informations).

This bug appears on Windows XP SP2 and 2003 Server with JRuby 1.3.1 but not with Ruby 1.8.6 (MRI).
I didn't test on Linux and with Redmine 0.8 branch.

uploading_attachment_file_with_jruby.patch Magnifier - Patch v1 (1.86 KB) Babar O'Cap, 2009-09-23 16:24

uploading_attachment_file_with_jruby_v2.patch Magnifier - Patch v2 (2.02 KB) Babar O'Cap, 2009-09-25 15:35

History

#1 Updated by Babar O'Cap about 10 years ago

Here a patch, tested successfully with JRuby 1.3.1 and Ruby 1.8.6 (MRI)

#2 Updated by Babar O'Cap about 10 years ago

Last patch raised errors when no attachment was given.

#3 Updated by Yves Schubert about 10 years ago

Sorry, I'm very new to Ruby.

How can I apply that patch? I can find the files, but they do not seem to match the files, given in the patch.

Thanks for your help.

Scyv

#5 Updated by Jean-Philippe Lang about 10 years ago

It seems to be a JRuby issue.

Using ruby 1.8.7:

irb(main):001:0> require 'tempfile'
irb(main):002:0> t = Tempfile.new("temp")
irb(main):003:0> t << "foo" 
irb(main):004:0> t.size
=> 3

Using JRuby 1.3.1 (latest stable):

irb(main):001:0> require 'tempfile'
irb(main):002:0> t = Tempfile.new("temp")
irb(main):003:0> t << "foo" 
irb(main):004:0> t.size
=> 0

#6 Updated by Jean-Philippe Lang about 10 years ago

  • Status changed from New to Closed
  • Resolution set to Wont fix

#7 Updated by Jean-Philippe Lang about 10 years ago

Now works with JRuby 1.4.0.

#8 Updated by Rolland Sawyers about 8 years ago

SPAM

Also available in: Atom PDF