I’m trying to do the classic file upload to a directory in my file
system (public/drawings). I have the following:
In the view:
<%= file_field ( “drawing”, “drawingfile” ) %>
In the controller, in addition to the usual .save, I have
In the model, I have
def save_drawing(inputfile) if inputfile.original_filename
|f| f.write(inputfile.read) }
The save_drawing routine is almost verbatim from the HowToUploadAFile
document. It IS creating a file in the right location in the file
system, but no data is being written to it (e.g. a zero length file).
What am I missing?
Thanks in advance