þetta ætti að duga:
mjög einfalt upload, ólíkt gamla ASP þá þarftu ekki einhvern upload component, allt innbyggt :)
<html><br>
<head><br>
<title>Untitled</title><br>
</head>
<p><body><br>
<?<br>
$sFileDir = "UploadedFiles/";<br>
If($sAction == "Upload"){<br>
If($File != ‘none’){//Ef að einhver skrá var send með<br>
if (copy ($File,$sFileDir.$File_name)) {<br>
$Success = 1;<br>
}else {<br>
$Success = 0;<br>
}<br>
<br>
If($Success == 1){<br>
//Ef upload tókst þá skrifa ég út smá
skilaboð<br>
echo ‘Skrá var uploadað!<br>’;<br>
echo ‘$File_name: ’.$File_name.'<br />';<br>
echo ‘$File_size: ’.$File_size.'<br />';<br>
echo ‘$File_type: ’.$File_type.'<br />';<br>
}Else{<br>
$NotaBene = ‘<b>Villa!</b><br /><br />’;<br>
$NotaBene .= ‘Ekki var hægt að setja skránna <b>’.$File_name.'</b>
í möppuna <b>'.$sFileDir.'</b> uppá vefþjón';<br>
$NotaBene .= ‘<br /> Vinsamlegast vertu viss um að skrifréttindi
séu á vefþjóni<br /><br />’;<br>
}<br>
}Else{<br>
echo ‘<b>Villa!!!</b>, engin skrá var send með’;<br>
}<br>
}Else{<br>
?><br>
<form name="frmUpload" method="post" enctype="multipart/form-data"
action="<?=$PHP_SELF?>"><br>
<input type="file" id="File" name="File" /><br>
<br>
<input type="submit" name="submit" value="Submit"
/><br>
<input type="hidden" name="sAction" value="Upload"
/><br>
</form><br>
<?}?><br>
</body><br>
</html></p>
kíktu síðan á þetta:
<a href="
http://www.php.net/manual/en/function.copy.php“ target=”_blank">
http://www.php.net/manual/en/function.copy.php</a>
<br><br><font color=“#333333”>/************************/
/* The code must be pure!!! */
/************************/ </font>
<hr style=“color: #666666; height: 1px; width:180px; border-style: dashed” align=“left”><b><font color=“#666666”>Haukur Már Böðvarsson</font></b>
<a href=“mailto:haukur@eskill.is”><font color=“#178AE8”>haukur@eskill.is</font></a>
<a href="
http://www.bodvarsson.com“ target=”_blank“><font color=”#178AE8">www.bodvarsson.com </font></a