Witam,
Mam taki problem, że nie mogę podać ścieżki do katalogu, w którym mają być ładowane pliki.
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>upload</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#0000ff" alink="#0000ff"
topmargin="0" marginheight="0">
<?
$mailheaders = "photo upload";
if ($email != "ftp.kassz@gmail.com") {
} else {
die("No email address specified.");
}
if ($superdat_name != "") {
copy("$superdat", "/your/full/path/httpd/upload/files/$superdat_name") or
die("Couldn't copy file.");
} else {
die("No input file specified."); }
mail("ftp.kassz@gmail.com","$mailheaders", "$email sent $superdat_name, a $superdat_size byte file with a MIME type of $superdat_type \n nome :$name\n message :$message");
?>
<html>
<head>
<body bgcolor=white text=black link=blue>
<!--Header/Logo-->
<p> </p>
<p> </p>
<p align=center><h3>Your upload has been sent!</h3></p>
<p align=center>You have uploaded:
<? echo "$superdat_name"; ?>, a
<? echo "$superdat_size"; ?>byte file with a mime type of
<? echo "$superdat_type"; ?>.See your photo <a href="http://www.yourwebsite\upload/files/
<? echo "$superdat_name"; ?>">here</a></p>
</body>
</html>
Ścieżka znajduje się w tym samym katalogu gdzie skrypt, czyli /public_html/up/files
Katalogowi "files" nadałem prawa 777 i po załadowaniu jakiegokolwiek pliku wywala" No input file specified."
ścieżkę podałem w taki sposób
if ($superdat_name != "") {
copy("$superdat", "/public_html/up/files/$superdat_name") or
die("Couldn't copy file.");
W pliku index.php nie zmieniałem nic
!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>upload</title>
</head>
<body bgcolor
="#ffffff" text
="#000000" link="#0000ff" vlink
="#0000ff" alink
="#0000ff" topmargin="0" marginheight="0">
<p> </p>
<div align=center width=98%><h3> Upload Foto</h2><FORM ACTION="upload.php" METHOD="POST" ENCTYPE="multipart/form-data">
<CENTER>
<TABLE WIDTH=450 BORDER=0 CELLPADDING=0 CELLSPACING=0 id=news>
<tr><td><b> Name :</b> </td>
<td ><input type="text" name="name" size="40" maxlength="80" ></td></tr>
<tr >
<td width=113><b> email : </b> </td>
<td width=289><p><input type=text name="email" size=30> </td>
</tr>
<tr >
<td width=113>
<p align=right><b>photo to be sent: </b> </td>
<td width=289>
<p
><input type
=file name
="superdat" size
=30></p
> </td>
</tr>
<tr>
<td colspan=2 align=center><b>Message:</b>
</td>
</tr>
<tr>
<td colspan=2 align=center>
<textarea name="message" rows="3" cols="40"></textarea> </td>
</tr>
</TABLE>
</CENTER>
<DIV ALIGN=CENTER>
<P STYLE="margin-bottom: 0in"><INPUT TYPE=SUBMIT NAME="submit" VALUE="Upload File"></P>
</DIV>
</FORM>
</body>
</html>