View Single Post
  #4  
Old 10-26-2012, 08:39 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,922

That would be a pretty big adjustment to the script.. you're probably better off to just delete files that were uploaded, if any in the group had an error... Try doing the below adjustments..

On line 249, after
PHP Code:
$success.="<b>URL:</b> <a href=\"".$full_url.$file_name[$i].".".$file_ext[$i]."\" target=\"_blank\">".$full_url.$file_name[$i].".".$file_ext[$i]."</a><br /><br />"
Add this
PHP Code:
$uploaded[]=$folder.$file_name[$i].".".$file_ext[$i]; 
Then on line 261, after this
PHP Code:
// Else Total Size 
Add this
PHP Code:
If($error) {
    
$success="";
    
$error.="<b>FAILED:</b> No files uploaded<br />";
    If(
is_array($uploaded) AND !empty($uploaded)) {
        For(
$i=0$i <= count($uploaded-1); $i++) {
            @
unlink($uploaded[$i]);
        }
    }


I did not test it, but it should work. You could also put the success files into an array, and if you get any errors by the end, loop through that array only to delete any uploaded files.
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote