<?php
if (isset($_FILES["file"]["name"]))
{
if ($_FILES["file"]["type"] == "application/x-download"
|| ($_FILES["file"]["type"] == "application/octet-stream" && strrchr($_FILES['file']['name'],'.')==".odt")
|| $_FILES["file"]["type"] == "text/plain")
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
move_uploaded_file($_FILES["file"]["tmp_name"],
'upload/'.count(glob("upload/*")).strrchr($_FILES['file']['name'],'.'));
echo "Thank You, we have receive your application form" . "<br />";
echo "We will contact you once your application has been processed!";
}
}
else
{
echo "ERROR: you have uploaded an Invalid file";
echo'<form action="upfile.php" method="post" enctype="multipart/form-data"><label for="file">Filename:</label><input type="file" name="file" id="file" /><br /><input type="submit" name="submit" value="Submit" /></form>';
}
}
else
{
echo"ERROR: there is no file selected or uploaded";
echo'<form action="upfile.php" method="post" enctype="multipart/form-data"><label for="file">Filename:</label><input type="file" name="file" id="file" /><br /><input type="submit" name="submit" value="Submit" /></form>';
}
?>
danholding 5 Junior Poster in Training
TrustyTony commented: php to Python without good subject even +0
nquinlan commented: Does not appear to take the forums seriously. +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Sorcher 6 Junior Poster
diafol
danholding 5 Junior Poster in Training
diafol
Sorcher 6 Junior Poster
danholding 5 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.