lib/sunrise/file_upload/http.rb in sunrise-file-upload-0.1.3 vs lib/sunrise/file_upload/http.rb in sunrise-file-upload-0.1.4
- old
+ new
@@ -49,10 +49,13 @@
super Digest::SHA1.hexdigest(filename), tmpdir
fetch
end
def fetch
- self.write @request.raw_post
+ body = @request.raw_post
+ body = body.force_encoding('UTF-8') if body.respond_to?(:force_encoding)
+
+ self.write body
self.rewind
self
end
def original_filename