upload script med fejl i
Jeg får denne fejlWarning: copy(): Unable to access in /var/www/mysite.dk/public_html/Admin/upload.php on line 25
Linie 25 er denne
copy($tempfile, $destination);
Her er hele koden:
<?php require_once('../Connections/cmsfoto.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Upload billede</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if (isset($_FILES['filnavn'])) {
print "Fil, der er blevet overført: {$_FILES['filnavn']['name']}<p>\n";
$query = "INSERT INTO billeder SET billednavn='".$_FILES['filnavn']['name']."'";
$Result1 = mysql_query($query, $billeder) or die(mysql_error());
}
{
$tempfile = $_FILES['filnavn']['tmp_name'];
$destination = "../billeder/{$_FILES['filnavn']['name']} ";
copy($tempfile, $destination);
}
?>
<p>Upload billede.</p>
<form action="upload.php" method="post" enctype="multipart/form-data" name="form1">
Fil der skal overføres:
<input name="filnavn" type="file" id="filnavn">
<br>
<input type="submit" name="Submit" value="Overfør">
</form>
<p> </p>
</body>
</html>
