افتح ملف index.php وابحث عن
كود PHP:
$userpath = $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']);
واستبدلها بالتالي:
كود PHP:
$userpath = $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']).'/upload/';
وابحث عن
كود PHP:
$httppath = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
واستبدلها بالتالي
كود PHP:
$httppath = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/upload/';
الآن قم بانشاء مجلد باسم upload بجانب ملف index.php وقم باعطاءه التصريح 777، ولا تنسى أن تقوم بحماية الجلد من رفع ملفات الشل، ابحث عن الطريقة في المنتدى وستجدها
إقتباس:
| How do I put the uploaded files in a different directory?
- Simply change these lines in your index.php
// upload files to where your index.php is
$userpath = $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']);
// or you may define your own
$userpath = "/home/yourusername/www/tmp/img";
// upload files to where your index.php is
$httppath = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
// or you may define your own
$httppath = "http://yourdomain.com/tmp/img"; |