multipart-post icon indicating copy to clipboard operation
multipart-post copied to clipboard

Uploaded Image Corrupted with JRuby 1.7.10

Open jimtsay opened this issue 11 years ago • 5 comments

For those using JRuby. Image upload may not work with this gem. Try the following code on JRuby:

f = File.open("test.png")
obj = f.read(f.size)

f.size and obj.size are not the same. It causes content-length and stream size not the same, and image file is corrupted.

jimtsay avatar Feb 04 '14 21:02 jimtsay

With which version(s) of JRuby are you seeing this problem?

sodabrew avatar Sep 11 '15 21:09 sodabrew

It's in the title. I didn't try any new version since then.

jimtsay avatar Sep 13 '15 03:09 jimtsay

Oh, yes it is. I missed that. Was hoping to that a newer version of JRuby since the issue was filed would have fixed the problem, but don't know.

sodabrew avatar Sep 13 '15 03:09 sodabrew

@sodabrew I am not using JRuby for a long time. Are you still seeing this in the latest JRuby? I had a workaround for this issue at that time.

jimtsay avatar Sep 13 '15 07:09 jimtsay

It would be good to make a spec for this to confirm correct behaviour - PR welcome.

ioquatix avatar May 03 '17 00:05 ioquatix