Forum: Ruby on Rails File upload problem with enctype

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
980f5824b1cd96f1882b7caf5bbaebdf?d=identicon&s=25 archerid (Guest)
on 2007-01-26 02: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" />
</form>

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.
980f5824b1cd96f1882b7caf5bbaebdf?d=identicon&s=25 archerid (Guest)
on 2007-01-26 16: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.