Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Como fazer o Upload de um ficheiro</title>
</head>
<body>
<div>
<?php
if ( isset( $_FILES['fupload'] ) ) {
$source = $_FILES['fupload']['tmp_name'];
echo $source;
echo "<br/>";
$target = $_FILES['fupload']['name'];
echo $target;
move_uploaded_file( $source, $target );
/*
$size = getImageSize( $target );
$imgstr = "<p><img width=\"$size[0]\" height=\"$size[1]\" ";
$imgstr .= "src=\"$target\" alt=\"Imagem enviada\" /></p>";
print $imgstr;
// }
*/
}
?>
</div>
<form enctype="multipart/form-data"
action="" method="post">
<p>
<input type="hidden" name="MAX_FILE_SIZE" value="10240000" />
<input type="file" name="fupload" /><br/>
<input type="submit" value="upload!" />
</p>
</form>
</body>
</html>
$source = $_FILES['fupload']['tmp_name'];
in my php file?
Thank you