Jump to content

file upload if file uploaded statement


calmchess

Recommended Posts

It depends on how you're doing the upload. If you're using a "move" command to a permanent folder after it loads to the temporary, it will return false if it fails, so you can use an if statement on the command itself.

 

Otherwise run a file_exists() at the target location to see if it was uploaded or not.

how does this look>?

 

$newname = uniqid("leg").$type1;
if(move_uploaded_file($_FILES['mailfile']['tmp_name'],
"../legalstorage/$getn/$newname")){
$_SESSION['setform']=true;
$_SESSION['pic']= 0;
header('Location: http://privatechatnow.com/currentwebsite/activation/upage.php?id='.$id);
}else{
$_SESSION['setform']=true;
$_SESSION['pic']= 1;
header('Location: http://privatechatnow.com/currentwebsite/activation/upage.php?id='.$id);
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.