Welcome Guest, Not a member yet? Register   Sign In
Unable to save file xxxx to final destination
#1

[eluser]Camd[/eluser]
We recently moved our website from a hosted service to our internal servers. We have a process where the content managers can upload a file. Unfortunately, this functionality no longer works and everyone receives a message “Unable to save file xxxx.jpg to file destination”.

We are using Cent OS 5.4 with PHP 5.2.10 and CodeIgniter 1.7.2.

I’ve traced the problem to the following code. To try and get past this error, I’ve set the directories to rwx for owner,group,public (the owner is also set to apache:apach). It still makes no difference. I’m at a lost at this point why it won’t work. I’m not too familar with CodeIgniter and am still in the process of learning it.

function add_uploaded_file($file_index, $field_name)
{
if (!isset($_FILES[$file_index][‘tmp_name’]))
{
$this->errors[‘upload’][] = “No file in index ‘$file_index’”;
return FALSE;
}

if (($field_info = $this->_get_file_field_details($field_name)) === FALSE)
{
$this->errors[‘upload’][] = “Unknown field name ‘$field_name’”;
return FALSE;
}

$upload_config = array(
‘upload_path’=> WEBROOT . ‘tmp’,
‘allowed_types’=>$field_info[‘allowed_types’]
);

$CI =& get_instance();
$CI->load->library(‘upload’);
$CI->upload->initialize($upload_config);

$file_path = $error = ‘’;
if ($CI->upload->do_upload($file_index))
{
$file_info = $CI->upload->data();

if ($this->_add_file_real($file_info, $field_name))
return TRUE;

if (empty($this->errors))
$this->errors[$field_name][] = “Unable to save file $file_info[orig_name] to final destination”;

if (file_exists($file_info[‘full_path’]))
unlink($file_info[‘full_path’]);
}
else
$this->errors[$field_name][] = “CI Uploader: ” . $CI->upload->display_errors(’‘, ’ ‘);

return FALSE;
}


Messages In This Thread
Unable to save file xxxx to final destination - by El Forum - 03-16-2010, 08:20 AM
Unable to save file xxxx to final destination - by El Forum - 03-16-2010, 09:09 AM
Unable to save file xxxx to final destination - by El Forum - 03-17-2010, 08:23 AM
Unable to save file xxxx to final destination - by El Forum - 03-17-2010, 08:50 AM
Unable to save file xxxx to final destination - by El Forum - 03-17-2010, 10:24 AM
Unable to save file xxxx to final destination - by El Forum - 03-17-2010, 10:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB