Add details about enctype = multipart/form-data to README
Susurrus - September 5, 2007 - 02:33
| Project: | Filemanager |
| Version: | 5.x-1.x-dev |
| Component: | Documentation |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I've run into problems multiple times forgetting to add $form['#attributes'] = array('enctype' => 'multipart/form-data');. This should be at least touched on in INSTALL/README or somewhere in /docs

#1
It would be rather odd to add an instruction to modify the code into the README, I'd probably just change the code if it was necessary.
I don't actually understand what you're asking for. Could you please provide more details. In particular, where (line number of current file would be nice) you're adding this line? And what problem are you trying to fix... the current version works for me as is.
Thanks,
- Steve
#2
There is not actually a problem with your code. The code works fine, it's just that to create a form that allows upload you need to add the 'enctype' attribute I stated in my initial post to the form array, or the file won't upload properly, if at all. I completely forgot that this enctype attribute was required. It would be good to have this stated in the documentation so that other users don't run into the same problems I did.
#3
Ok, NP. But where does this go. Maybe it should be in the code, either in Filemanager or Attachment (oh, just looked, it is in the Attachment code). Or, since Filemanager is an API, we're trying to tell API users that they need to make sure they include this?
#4
It looks like there's already an Important Notes section in the INSTALL file. I envision something like the following added to the end:
Also, be sure that you are specifically adding an 'enctype' attribute to yourforms that has the value 'multipart/form-data' which can be done with the
following line:
$form['#attributes'] = array('enctype' => 'multipart/form-data');
#5
I've put it into the README, it seemed better to add an API notes section there. It's in CVS.
Thanks,
- Steve
#6