Я использую условно для загрузки изображения:
if($row["website"] == 'mywebsite') {
move_uploaded_file($_FILES["applicant_passport_size_photo"]["tmp_name"],"https://www.mywebsite.com/upload/user_photo/".$f_name);
}else {
move_uploaded_file($_FILES["applicant_passport_size_photo"]["tmp_name"],"../upload/user_photo/".$f_name);
}