dumachst ein <input type="file" name="upload_file"> im formular..
HTML-Forumular:
Code:
<html>
<body>
<form enctype="multipart/fom-data" action="upload.php" method="post">
Datei: <input type="file" name="upload_file">
<input type="submit">
</form>
</body>
</html>
Upload.php
PHP-Code:
<?php
$upload_file = $HTTP_POST_VARS['upload_file'];
$upload_file_name = $HTTP_POST_VARS['upload_file_name'];
//Link zu dem Directory, in dem das Bild gespeichert werden soll
$upload_path = "./bilder";
//hochladen
copy($upload_file, "$upload_path/$upload_file_name");
//höhe und breite ermitteln
list($file_width, $file_height) = getimagesize("$upload_path/$upload_file_name");
if($file_width > 120 or $file_height > 150)
{
unlink("$upload_path/$upload_file_name");
//wenn zu groß, wieder löschen
}
?>