Php文件上载脚本
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Php文件上载脚本相关的知识,希望对你有一定的参考价值。
General file upload script in php. Error set using SESSIONS.
} $max_size = 10000; // maximum file size, in KiloBytes $file = $ref_id; //Name of file when uploaded // Checks if the file has allowed type and size $_SESSION['status'] = 1; echo '<script> window.location.href = "redirect.php"; </script>'; } if ($_FILES['fileToUpload']['size'] > $max_size * 1000) { $_SESSION['status'] = 2; echo '<script> window.location.href="redirect.php"; </script>'; } $uploadpath = 'directory/' . $file; // gets the file name } else { $_SESSION['status'] = 3; echo '<script> window.location.href = "redirect.php"; </script>'; } }
以上是关于Php文件上载脚本的主要内容,如果未能解决你的问题,请参考以下文章