16-08-2005, 16:13
|
|
|
חבר מתאריך: 14.08.05
הודעות: 4
|
|
לפני כל הסטטיסטיקות אני רוצה להעלות את הקובץ בשלום
מה השגיאה?
קוד:
Warning: move_uploaded_file(/usr/home/sb_ftp/users/xyyyx/pic/xYYYx2.jpg): failed to open stream: Permission denied in /usr/home/sb_ftp/users/xyyyx/pic/upload.php on line 21
Warning: move_uploaded_file(): Unable to move '/var/tmp/phpEgr5Qy' to '/usr/home/sb_ftp/users/xyyyx/pic/xYYYx2.jpg' in /usr/home/sb_ftp/users/xyyyx/pic/upload.php on line 21
אני מקווה שזה יעזור לפענח מה לא עשיתי בסדר בקוד:
קוד PHP:
<!-- The data encoding type, enctype, MUST be specified as below --> <form enctype="multipart/form-data" action="upload.php" method="POST"> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> <!-- Name of input element determines name in $_FILES array --> Send this file: <input name="userfile" type="file" /> <input type="submit" value="Send File" /> </form> <?php // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead // of $_FILES. $uploaddir = '/usr/home/sb_ftp/users/xyyyx/pic/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; ?>
|