Closed (won't fix)
Project:
Drupal core
Version:
4.7.2
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2006 at 04:06 UTC
Updated:
24 Jun 2006 at 20:59 UTC
According to the api docs, #default_value is a supported property of the file form control.
However this isn't working in my testing. Example:
$form[$fieldname] = array(
'#type' => 'file',
'#title' => t($field->label),
'#description' => ($node->$fieldname ? t('"%filename" has been uploaded. If you upload another file, the current file will be replaced.', array('%filename' => $node->$fieldname->filename)) : '') . t($field->description),
'#required' => $field->required,
'#weight' => $field->weight,
'#default_value' => 'TESTING.txt',
);
Comments
Comment #1
dgtlmoon commentedI agree, its not working here either
Comment #2
dgtlmoon commentedturns out it is not supported on most browsers due to security issues
(ie: you could set the default value to be c:\somesecretfile, hide the file field in a no-display div and then just show the submit button...)
Comment #3
webchickYeah. See Input File Value thread on Evolt.org for further details.
The value type in file input fields is not supported by any browser that I know of for these reasons. Doesn't make sense for Drupal to support it either. Setting to won't fix.