The file '.$_FILES['file']['name'].' was uploaded successfuly. Please remember to click the submit button to save the post
'; $operationSuccess = "true"; } elseif ($_FILES['file']['error'] == UPLOAD_ERR_INI_SIZE) $result_msg = 'The uploaded file exceeds the maximum upload limit
'; else $result_msg = 'The upload failed
'; } elseif (isset($_POST['upload_url']) && (!empty($_POST['upload_url']))) // file was send from browser { if ( (substr($_POST['upload_url'],0,4) != "http") && (substr($_POST['upload_url'],0,3) != "ftp")) $_POST['upload_url'] = "http://".$_POST['upload_url']; $filename = DownloadFile(); if (false == $filename) { if ($acceptedExtsString != "") $infoStr = ". Make sure the file ends with: $acceptedExtsString"; $result_msg = "Error downloading file: ".$_POST['upload_url'].$infoStr; } else{ $result_msg = 'The URL '.$_POST['upload_url'].' was downloaded successfuly. Please remember to click the submit button to save the post
'; $operationSuccess = "true"; } } // If operation is success, make sure the file was created properly if ($operationSuccess == "true"){ if ($fp_check_file = @fopen(dirname(__FILE__) . '/files/' . $filename, 'rb')) { fclose($fp_check_file); } else{ $operationSuccess = "false"; $result_msg = "Failed to upload the file!"; } } ?>