File titles are limited to 128 characters, though Drupal nodes title length extend to 255 characters.

Any reason for this limitation, is it possible to allow standard node title length for files?

Thanks

Comments

johanneshahn’s picture

hi,
currently the file node title use the drupal
default maxlength => 128 -> see http://api.drupal.org/api/drupal/developer%21topics%21forms_api_referenc...
part "Default Values".
of course we can push this up to 255 characters.
but i've tested it with chrome browser and there was limit
of 180 characters. the download breaks.

to test it u can set manually maxlength in file.module function file_node_form(&$node, $form_state) {
near line 585

if ($type->has_title) {
$form['title'] = array(
      '#type' => 'textfield', 
      '#title' => check_plain($type->title_label), 
      '#required' => TRUE, 
      '#default_value' => $node->title, 
      '#weight' => -5,
      '#maxlength' => 255,
    );
...
jvieille’s picture

I think that this limit must match OS limits of 255 char like Windows / Mac.
In windows, this number is for the full path, meaning that you can barely use this number in practice (unless you upload the file at the root of a drive), maybe explaining why your test failed in Chrome at 180 char.

Thanks

jvieille’s picture

I suggest setting the limit at 255, but put a not in the readme.txt file about possible issues when downloading file.

gobinathm’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing the issue. It was inactive for a long time & it's related to a Drupal Version which is not supported anymore