Forum: Ruby on Rails Simple file upload help

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Paul S. (Guest)
on 2006-02-25 15:34
(Received via mailing list)
I'm trying to implement the simple file upload example at

However, I'm getting an error "No such file or directory" when I
submit the form...

Errno::ENOENT in Admin/websites#create
No such file or directory - /images/websites/websitename.jpg

I believe it's relating to the code in the model:

def"/images/websites/#{website['name']}.jpg", "w") { |f|
f.write(website['filename'].read) }

>From what I understand it is trying to open the file at
/images/websites/websitename.jpg which doesn't exist. I'm not entirely
sure how this file upload is supposed to work, but essentially I just
want a simple upload that places a file into that location from my
public directory.

Any help would be greatly appreciated,
This topic is locked and can not be replied to.