File upload not working on Mac OS X development environment
Update: Solution
slarosa reported on this "Files Don't Attach" thread that the only thing that fixed file uploading was:
EXPLICITLY SET the upload tmp dir in php.ini to be THE SAME of the tmp dir set up in the file upload config in Drupal; for instance:
vi /Applications/xampp/etc/php.ini
Then in the file, make sure this is set and not commented out:
upload_tmp_dir = /tmp
That's how to do it.
For historical fun Agaric's misdirected debugging will stay down here.
Added drupal_set_message debug code
<?php
function file_save_upload($source, $validators = array(), $dest = FALSE, $replace = FILE_EXISTS_RENAME) {
global $user;
static $upload_cache;
// Add in our check of the the file name length.
$validators['file_validate_name_length'] = array();
// Return cached objects without processing since the file will have
// already been processed and the paths in _FILES will be invalid.
if (isset($upload_cache[$source])) {
return $upload_cache[$source];
}
drupal_set_message('<pre>'.var_export($_FILES,TRUE).'</pre>');
//...
}
?>
Result:
array (
'files' =>
array (
'name' =>
array (
'upload_file' => 'sample-OBO_gene_ontology.obo',
),
'type' =>
array (
'upload_file' => '',
),
'tmp_name' =>
array (
'upload_file' => '',
),
'error' =>
array (
'upload_file' => 6,
),
'size' =>
array (
'upload_file' => 0,
),
),
)
Comments
thats it
I set temp directory to /Applications/xampp/tmp
Give permissions for that dir and the tranfer directory attach...
Post new comment