دانلود - آموزش - سورس کد - کنکور - برنامه

دانلود - آموزش - سورس کد - کنکور - برنامه

دانلود - آموزش - سورس کد - کنکور - برنامه

دانلود - آموزش - سورس کد - کنکور - برنامه

آپلود بیش از ۲ مگابایت در php

How to upload files which are larger than 2 MB

', CAPTION, 'Table of Contents', BELOW, RIGHT, FGCOLOR, '#FFF2CC', BGCOLOR, '#ffe699', TEXTCOLOR, '#000000', CAPCOLOR, '#000000', STICKY, MOUSEOFF, WIDTH, 400);">Table of Contents Next

If you want to upload files using PHP to a server which are larger than 2 MB and there is a limit (e.g. 2 MB) on the server, you can do following steps:

  • See your PHP Info - create file called e.g. info.php and add following php code to this file:

 


echo phpinfo();

 

  • Run this file on your server and you will see all PHP settings
  • See upload_max_filesize directive

 

alt

 

It is your server:

  • If there is only 2M (2 MB), you should increase your upload filesize in your php.ini
  • Open your php.ini (linux: /etc/php.ini, windows: C:\WINDOWS or C:\WINNT) and change or add the following piece of code:

 

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Maximum allowed size for uploaded files

upload_max_filesize = 4M

 

  • Save your php.ini and restart your server

It is not your server:

  • Try to add the following code to your index.php file (or your main script file):

 

ini_set('upload_max_filesize', '4M');

 


نظرات 0 + ارسال نظر
برای نمایش آواتار خود در این وبلاگ در سایت Gravatar.com ثبت نام کنید. (راهنما)
ایمیل شما بعد از ثبت نمایش داده نخواهد شد