Closed (fixed)
Project:
Drupal core
Version:
5.1
Component:
upload.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 May 2007 at 22:48 UTC
Updated:
25 Jan 2010 at 01:23 UTC
This can be done by putting something like that in the upload_js():
if (variable_get('upload_max_number_of_file', 1)==sizeof($node->files))
unset($form['new']);This solutions is "nice" as it will not display any error, the user simple can't attach more file as there will be no controls on the form for that ;-)
This is just an idea but I need such a feature.
Thank you
Comments
Comment #1
MrPrise commentedMy previous hack was not correct. Here is a better one ;-)
In the function _upload_form() the line
if (user_access('upload files')) {should be changed to
if ((user_access('upload files')) && (variable_get('upload_max_number_of_file', 1)>sizeof($node->files))) {Comment #2
MrPrise commentedJust one more think. This limit will be more powerful if we can specify the limit per content type.
The ability to hide the file's description field would be nice too.
Comment #3
marcingy commentedFixed as filefield is now in core and allows for limits.
Comment #4
marcingy commented