Login   Register  
PHP Classes
elePHPant
Icontem

file_overwrite

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      class.upload.php  >  All threads  >  file_overwrite  >  (Un) Subscribe thread alerts  
Subject:file_overwrite
Summary:file_overwrite does not work
Messages:2
Author:Said Bakr
Date:2008-04-08 23:58:33
Update:2009-04-23 05:23:23
 

  1. file_overwrite   Reply  
Picture of Said Bakr
Said Bakr
2008-04-08 23:58:33
Hi,

The property file_overwrite when set to true should lead to overwrite the new prcessed file if there is a file with the same name. The situation I found that it keeps trailing the new file name with _x where x is an integer. Is using file_new_name_body make a confilict?

Here is the code:

function upImage($dest,$frmFld,$name){
global $siteAbsPath;
require($siteAbsPath.'/scripts/class.upload.php');
$handle = new upload($_FILES[$frmFld]);

if ($handle->uploaded){
$handle->file_overwrite = true;
$handle->file_new_name_body = $name;
$handle->image_resize = true;
$handle->allowed = array('image/*');
$handle->file_max_size = '21000';
$handle->image_x = 60;
$handle->image_ratio_y = true;

$handle->process($dest);

if ($handle->processed) {
$handle->clean();
//die();
return true;
} else {
die( 'error : ' . $handle->error);
}

}

}

  2. Re: file_overwrite   Reply  
Picture of Mojoinst H
Mojoinst H
2009-04-23 05:23:23 - In reply to message 1 from Said Bakr
I am having the same problem... very freustrating!

Anyone know where to fix?