Forum: Ruby on Rails Upload problem when file is small/StringIO

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
098e03c0baa97f4bcb3adda809fb19a1?d=identicon&s=25 Ant Peacocke (Guest)
on 2006-05-03 19:08
(Received via mailing list)
Hi

I am having a problem with uploading small files.

These are StringIO objects rather than temporary files as with the
larger file uploads.

The problem is that when it is a StringIO rather than a temporary file
nothing is returned from the read method.

example code where "image" is the file upload form parameter, it works
fine if image is over round 19k:

File.open(path_1 + path_2, "wb") {|f| f.write(image.read) }

Cheers
Ant


--
Ant Peacocke

www.levelsystems.net
T:  + 33 (0) 8 70 46 63 37
M:  + 33 (0) 6 09 81 06 00
This topic is locked and can not be replied to.