Any Idea?

edited February 2012 in Modules
I have a number of models that upload pdf files. They are almost identical, yet one stubbornly does not work correctly

function form_fields($values = array()) { $fields = parent::form_fields($values); $upload_path = assets_server_path('userfiles/files', 'pdf'); $fields['ConfMenuItemPdf'] = array('description' => 'PDF File', 'class' => 'asset_select userfiles/files', 'upload_path' => $upload_path); $fields['ConfMenuItemPdf_upload'] = array('type' => 'file', 'accept' => 'pdf','upload_path' => $upload_path, 'overwrite' => TRUE); $fields['ConfMenuItemPdf']['order'] = 10; $fields['ConfMenuItemPdf_upload']['order'] = 11; $fields['published']['order'] = 1000; return $fields; }

If I upload a pdf file, the file uploads and gets into the correct directory. However, the field ConfMenuItemPdf does not get saved.

Yet if I use the Asset Select and pick the file out of the dropdown list, the field ConfMenuItemPdf does get set.

I've also tried it with just an option to upload
$fields['ConfMenuItemPdf'] = array('type' => 'file', 'accept' => 'pdf','upload_path' => $upload_path, 'overwrite' => TRUE);

And that also uploads the file but fails to save the name.

Any clues?

Thanks.

Comments

  • edited 10:22PM
    Tough to say, however, I can point you in a direction to debug I think which would be around lines 680-720ish of the fuel/modules/fuel/module.php file. There it loops through the $_FILES array to try and grab the name of the uploaded file to insert as the $_POST value.
Sign In or Register to comment.