PDA

View Full Version : مشکل در کد uplaod فایل



mostafa_shaeri_tj
دوشنبه 05 آذر 1386, 11:29 صبح
با سلام و خسته نباشید .
کد upload من توی کامپیوتر خودم جواب میده ولی وقتی این صفحه رو توی سایت میزارم و امتحان می کنم همچین چیزی میگه :


Warning: move_uploaded_file() [function.move-uploaded-file (file:///C:/Documents%20and%20Settings/dadgostari/Desktop/New%20Folder/function.move-uploaded-file)]: open_basedir restriction in effect. File(C:\PHP\TEMP\php12CE.tmp) is not within the allowed path(s): (e:\servercover\104248\dadgostary\dadgostary-golestan.ir) in e:\servercover\104248\\\www\testphp\upload2.php on line 28



Warning: move_uploaded_file() [function.move-uploaded-file (file:///C:/Documents%20and%20Settings/dadgostari/Desktop/New%20Folder/function.move-uploaded-file)]: open_basedir restriction in effect. File(C:\PHP\TEMP\php12CE.tmp) is not within the allowed path(s): (e:\servercover\104248\dadgostary\dadgostary-golestan.ir) in e:\servercover\104248\\www\testphp\upload2.php on line 28



Warning: move_uploaded_file(C:\PHP\TEMP\php12CE.tmp) [function.move-uploaded-file (file:///C:/Documents%20and%20Settings/dadgostari/Desktop/New%20Folder/function.move-uploaded-file)]: failed to open stream: Operation not permitted in e:\servercover\104248\r\www\testphp\upload2.php on line 28



Warning: move_uploaded_file() [function.move-uploaded-file (file:///C:/Documents%20and%20Settings/dadgostari/Desktop/New%20Folder/function.move-uploaded-file)]: Unable to move 'C:\PHP\TEMP\php12CE.tmp' to 'ul2/backmnu1.JPG' in e:\servercover\104248\\www\testphp\upload2.php on line 28


اگه ممکنه راهنمایی ام کنید .

moohssenn
دوشنبه 05 آذر 1386, 15:08 عصر
احتمالا مشکل از دسترسی به فولدری است که میخواهید در اون فایل را Upload کنید . در سرورهای لینوکسی باید سطح دسترسی را مشخص کنید . جستجو کنید درباره این موضوع قبلا بحث شده است
موفق باشید

imankho
دوشنبه 05 آذر 1386, 17:41 عصر
یک بار دیگه مسیر های ذخیره فایل ها رو توی سرور چک کن!
کار آقا محسن هم یادت نره حتما سطح دسترسی رو هم چک کنی.

tizdast
دوشنبه 05 آذر 1386, 19:33 عصر
شما سه تا قسمت برای دسترسی به فوادر در سرور داری که شامل : excute,read,write هست که اگر تنظیمات رو تغییر بدی مشکلت به راحتی حل میشه.

mostafa_shaeri_tj
چهارشنبه 07 آذر 1386, 17:43 عصر
با سلام و تشکر از کمکتون .من سطح دسترسی پوشه ای که میخوام توش فایل رو آپلود کنم رو درست کردم یعنی سطح دسترسی اونو full control کردم یعنی همه کاری میشه توش کرد. ولی متاسفانه درست نشد .
با توجه به خطایی که میده فکر میکنم مسیر پوشه ی temp رو پیدا نمیکنه .البته این برداشت من بوده.
کماکان سردرگمم.:ناراحت::ناراحت:
ممنون میشم اگه بیشتر کمکم کنین.

Folaani
چهارشنبه 07 آذر 1386, 21:32 عصر
open_basedir string

Limit the files that can be opened by PHP to the specified directory-tree, including the file itself. This directive is NOT affected by whether Safe Mode is turned On or Off.

When a script tries to open a file with, for example, fopen() or gzopen(), the location of the file is checked. When the file is outside the specified directory-tree, PHP will refuse to open it. All symbolic links are resolved, so it's not possible to avoid this restriction with a symlink.

The special value . indicates that the working directory of the script will be used as the base-directory. This is, however, a little dangerous as the working directory of the script can easily be changed with chdir().

In httpd.conf, open_basedir can be turned off (e.g. for some virtual hosts) the same way as any other configuration directive with "php_admin_value open_basedir none".

Under Windows, separate the directories with a semicolon. On all other systems, separate the directories with a colon. As an Apache module, open_basedir paths from parent directories are now automatically inherited.

The restriction specified with open_basedir is actually a prefix, not a directory name. This means that "open_basedir = /dir/incl" also allows access to "/dir/include" and "/dir/incls" if they exist. When you want to restrict access to only the specified directory, end with a slash. For example: "open_basedir = /dir/incl/"

Note: Support for multiple directories was added in 3.0.7.

The default is to allow all files to be opened.

ealvandi
پنج شنبه 08 آذر 1386, 14:21 عصر
به این آدرس سری بزنید شاید به دردتون بخوره.
http://barnamenevis.org/forum/showthread.php?t=64375

mostafa_shaeri_tj
شنبه 10 آذر 1386, 12:37 عصر
فکر نمی کنم کد بالا مشکل منو حل کنه .من نمی خوام فایل رو باز کنم من میخوام از تابع move_uploaded_file() استفاده کنم که نمیشه .
خواهش میکنم کمکم کنین.

cybercoder
دوشنبه 12 آذر 1386, 12:49 عصر
به این آدرس سری بزنید شاید به دردتون بخوره.
http://barnamenevis.org/forum/showthread.php?t=64375

ربطی نداره
مشکل سطح دسترسیه

mostafa_shaeri_tj
سه شنبه 20 آذر 1386, 10:35 صبح
خواهش می کنم یک عزیزی به من کمک کنه. خیلی گیر این کارم.
ممکنه که مشکل از host باشه ؟

yashaaa
سه شنبه 20 آذر 1386, 19:30 عصر
دوست عزیز برای آپلود کردن فایل شما باید در سرور آدرس رو به گونه دیگری بنویسید برای آپلود کردن اون آدرسی که می نویسی توی کامپیوترت رو سرور جواب نمی ده
مثلا

"/usr/home/technotoos/domains/technotoos.com/public_html/uploadpic/".$_FILES['image']['name']);