Hej
Using Drupal v 4.7
I've hacked up the attachment module to work with a custom module that i've designed.
The overall goal is that this custom module is the only one which users can add content to, and that content consists of a few text fields and an uploaded file. I felt that the advantages of the filemanager module were worth keeping, so i borrowed the code from the attachment module that looked good.
Most of my work seems to be functioning very well; except with what goes on with the myNode_add().
This function gets called from within myNode_nodeapi() during the following check:
......
case 'prepare':
if (isset($_POST['edit']['attachments'])) {
$node->attachments = $_POST['edit']['attachments'];
}
if ($_POST['fileop'] == t('Add')) {
myNode_add($node);
}
......
this leads to the following:
function myNode_add(&$node) {
$file = file_check_upload('attachment_file');
if (!$file) {
form_set_error('attachment_file', t('No file, not appropriate.'));
return $node;
}
.....
This works fine with any file i try to add, except ones that end with .flv, which produce the error message "No file, not appropriate" . Even files without any extensions get added with no problem. I can't quite figure out why, and this is a problem because the content being uploaded with be video files, and we expect to use flv for most.