0

i am using html5 multiple attribute in a file field, like

<input type="file" name="image[]" multiple>

and then via php for loop i add those images, now the problem is occurring that on localhost user can upload up to 9 normal size images but on server he can upload only 2,3 images at a time so how to increase the number of images to be uploaded or size of all the images to be uploaded???

i tried php

ini_set('max_execution_time', 300); 

and

set_time_limit(100); 

as well but no profit.

Cœur
  • 37,241
  • 25
  • 195
  • 267
ahsanali
  • 83
  • 1
  • 5
  • What is the error code that you receive? – Ohgodwhy Sep 19 '14 at 16:38
  • So is this question about "html5 multiple file attribute" or processing multiple file uploads in PHP? – Charlie Schliesser Sep 19 '14 at 16:38
  • Sarcasm aside, you're interested in the following parameters in your `php.ini` file: `max_execution_time = 300`, `upload_max_filesize = 100M`, `max_file_uploads = 20`, `post_max_size = 8M`. – Charlie Schliesser Sep 19 '14 at 16:40
  • @Ohgodwhy i dont receive any error code instead it doesn't upload any at all – ahsanali Sep 19 '14 at 16:45
  • @CharlieS i need solution either way and most probably it is related to php because multiple files aren't uploading – ahsanali Sep 19 '14 at 16:47
  • Debug this on the server by setting the config values from my 2nd comment, verifying that the values are taking place via `phpinfo()` or equivalent, and then further debugging by checking the value of the `$_FILES` superglobal (i.e. `var_dump($_FILES); exit();` to see what data is actually being posted and available to you in PHP. Also, you probably are encountering an error and just don't know how to find it. If error reporting is turned off, turn it on: http://php.net/manual/en/function.error-reporting.php, http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php – Charlie Schliesser Sep 19 '14 at 17:51

1 Answers1

0

create a .htaccess in the root of your project, like i had already in the cakephp and then paste these two lines in the end of the document

  php_value upload_max_filesize 60M
  php_value post_max_size 60M

and save, and now you can select 20+ as well in one selections

cheers!

ahsanali
  • 83
  • 1
  • 5