On Drupal 4.7, Windows XP, flexinode CVS.

With a simple "add file" type, the file is uploaded to the temp directory (c:\windows\temp) and then is not moved to the "files" directory. This not happens with an "image" object: it is correctly uploaded to the "files" directory.

:-)

Comments

francoud’s picture

Status: Active » Needs review

Drupal 4.7, flexinode cvs, on windows. The "add file" type didnt upload to the correct "files" directory - file remained in the c:\windows\temp !

I just added:

$node->$fieldname = file_save_upload($node->$fieldname, $node->$fieldname->filename); //FB

in the function flexinode_field_file_insert($field, $node) in field_file.inc.. and seems working.. I am not expert, should be reviewed...

function flexinode_field_file_insert($field, $node) {
$fieldname = 'flexinode_'. $field->field_id;
$node->$fieldname = file_save_upload($node->$fieldname, $node->$fieldname->filename); //FB
$serialized = is_object($node->$fieldname) ? serialize($node->$fieldname) : '';
db_query("INSERT INTO {flexinode_data} (nid, field_id, textual_data, serialized_data) VALUES (%d, %d,
'%s', '%s')", $node->nid, $field->field_id, $node->$fieldname->filename, $serialized);
}