Looking for a quick and simple way to upload files?

Hi List,

I'm Jen and this is my first post :P

I won't bore you with pages of introduction, so here is my

problem/question.

I'm pretty new to web programming and rails. I've been looking for a

simple way to upload files to a directory, so I can use GIT to version them etc. I don’t want anything stored in a database.

I'm trying to adapt code from a tutorial and blog, but looking at

the blog comments no one seemed to be able to get it working. The link to the blog is:

  [      rails:

File upload in rail](rails: File upload in rails)

[      The

blog contains the link to the tutorial.](rails: File upload in rails)

The form I have adapted renders OK, but when I try to submit a file

for upload I get the following result:

NoMethodError in UploadController#create

undefined method `original_filename' for nil:NilClass

`

  `

Rails.root: /home/resource_portal/website

My controller, model and view are attached. I'm using Ruby-1.9.2 and

Rails3

Any help with this would be great.

Thanks in advance,

Jen.

upload_controller.rb (253 Bytes)

data_file.rb (358 Bytes)

upload.rhtml (187 Bytes)

Hi List,

I'm Jen and this is my first post :stuck_out_tongue:

I won't bore you with pages of introduction, so here is my problem/question.

I'm pretty new to web programming and rails. I've been looking for a simple way to upload files to a directory, so I can use GIT to version them etc. I don't want anything stored in a database.

I'm trying to adapt code from a tutorial and blog, but looking at the blog comments no one seemed to be able to get it working. The link to the blog is:

rails: File upload in rail <http://railshafeez.blogspot.com/2009/02/image-uploading-with-plugin.html&gt;

The blog contains the link to the tutorial. <http://railshafeez.blogspot.com/2009/02/image-uploading-with-plugin.html&gt; The form I have adapted renders OK, but when I try to submit a file for upload I get the following result:

There's a mistake in those instructions - given that the file_field is called :upload, the save method should be using upload['upload']

Fred