Upload problem when file is small/StringIO (read method retu

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 but is it is smaller then image.read
returns nothing however the image.size and image.original_filename
return the correct information.

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs