evo ti skripta za upload
ovo ti je forma za upload:
<html>
<head>
<title>Upload a File</title>
</head>
<body>
<h1>Upload a File</h1>
<form enctype="multipart/form-data" method="post" action="uploadFile.php">
<p>File to Upload:
<input type="file" name=“userfile" size="30"></p>
<p><button type="submit“>Upload File</button></p>
</form>
</body>
</html>
i skripta:
<?php
if ( $_FILES['userfile']['name'] != "" )
{
copy($_FILES['userfile']['tmp_name'],
"/tmp/".$_FILES['userfile']['name'])
or die("Could not copy the file! Are directory permissions correct?"

; }
else
{
die("You did not specify an input file"

;
}?>
<html><head><title>File Received</title>
<body><h1>File Received</h1>
<p>The following file has been received:
<?php
echo $_FILES['userfile']['name']; ?>,
containing <?php echo $_FILES['userfile']['size']; ?> bytes
and of MIME type <?php echo $_FILES['userfile']['type']; ?>
.</p></body></html>