Welcome Guest, Not a member yet? Register   Sign In
Manipulte uploaded file before saving
#6

[eluser]fesweb[/eluser]
It depends on what you mean by "before." You can rename the file without creating a temporary file to be deleted.
Code:
$base_name = 'upload'.$id;

$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'pdf|doc';
$config['max_size'] = '2048';
$config['encrypt_name'] = TRUE;

$this->upload->initialize($config);
$this->fileinfo = $this->upload->data();

$base_name_full_path = $this->fileinfo['file_path'].$base_name.$this->fileinfo['file_ext'];

$rename_it = rename($this->fileinfo['full_path'], $base_name_full_path);
Does that do anything for you?


Messages In This Thread
Manipulte uploaded file before saving - by El Forum - 08-25-2008, 08:56 AM
Manipulte uploaded file before saving - by El Forum - 08-25-2008, 09:27 AM
Manipulte uploaded file before saving - by El Forum - 08-25-2008, 10:09 AM
Manipulte uploaded file before saving - by El Forum - 08-25-2008, 10:33 AM
Manipulte uploaded file before saving - by El Forum - 08-25-2008, 10:50 AM
Manipulte uploaded file before saving - by El Forum - 08-25-2008, 01:22 PM
Manipulte uploaded file before saving - by El Forum - 08-26-2008, 07:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB