Created
December 29, 2014 10:35
-
-
Save alufers/3f728ffcdf7094273b15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf8" /> | |
<style> | |
body{ | |
font-family: Verdana; | |
} | |
</style> | |
<title>Upload</title> | |
</head> | |
<body> | |
<div> | |
<form enctype="multipart/form-data" action="?" method="POST"> | |
<input type="hidden" name="MAX_FILE_SIZE" value="50000" /> | |
<input name="plik" type="file" /> <br> | |
Nazwa: <input name="name" type="text" /> <br> | |
<input type="submit" value="Wyślij plik" /> <br> | |
</form> | |
</div> | |
<?php | |
$plik_tmp = $_FILES['plik']['tmp_name']; | |
$plik_nazwa = $_POST['name']; | |
$plik_rozmiar = $_FILES['plik']['size']; | |
if(is_uploaded_file($plik_tmp)) { | |
move_uploaded_file($plik_tmp, "tmp/$plik_nazwa"); | |
echo "Plik: <strong>$plik_nazwa</strong> o rozmiarze | |
<strong>$plik_rozmiar bajtów</strong> został przesłany na serwer!"; | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment