Forum: Ruby on Rails File upload problem with enctype

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.
archerid (Guest)
on 2007-01-26 03:29
(Received via mailing list)
Hi All,

I'm having a problem with a simple file upload page. I've narrowed it
down to the enctype attribute of the form tag. Here's my form:

<form action="/app1/gpxdata/upload_gpxfile" method="POST"
enctype="multipart/form-data" >
   <input type="file" size="50" id="gpxfile" />
   <input id="gpxupload" type="submit" value="Load GPX from file" />

When I submit this form, I get a 404-File not found error. I can access
upload_gpxfile directly, via typing the url directly into my browser,
so the path in the action tag is correct, but it seems that when I
submit the form, the web server can't find it.

The interesting thing is that when I remove the enctype attribute in
the form tag, the form submits just fine, although I can't access the
file I'm trying to upload, but that's to be expected, given the missing
enctype attribute.

Any ideas?

Thanks in advance.
archerid (Guest)
on 2007-01-26 17:30
(Received via mailing list)
Never mind, I figured it out. The file input field didn't have a "name"
attribute, just an idea, so that was causing the error. It seems like a
strange way for the app to behave.
This topic is locked and can not be replied to.