-3

This is my code and I need more size for image files because I can upload up to 1M

// Place image in the folder
$newname = "$pid.jpg";
move_uploaded_file( $_FILES['fileField']['tmp_name'], "../inventory_images/$newname");
header("location: inventory_list.php");
exit();
Giacomo1968
  • 25,759
  • 11
  • 71
  • 103

1 Answers1

0

You need to edit the php.ini file on your server like so; making it 2M to cover for overhead:

upload_max_filesize = 2M
post_max_size = 2M

Or you can add this to your site’s .htaccess file:

php_value upload_max_filesize 2M
php_value post_max_size 2M

Since you say you are using XAMPP, you should look at this answer and this blog post. If you are on Windows, look here, C:/xampp/php/php.ini. Open that file, find the settings for upload_max_filesize and post_max_size, change them and restart XAMPP. You should be good to go then.

Or just open up or create an .htaccess file in your web server root for XAMPP and add those two lines above with the php_value prefix.

Community
  • 1
  • 1
Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
  • OK!So i must create this file and that's it?how my php communicate with php.ini.im sorry but im new in php.. – user3717204 Jun 07 '14 at 06:28
  • 1
    @user3717204 You are in over your head. You do not create `php.ini`. It is a server side configuration file that controls PHP. You edit that to change these values. But if you are this lost, you might need someone else to do this for you. – Giacomo1968 Jun 07 '14 at 06:29
  • i use xampp..what's the src for php.ini? – user3717204 Jun 07 '14 at 06:33