Jump to content

Recommended Posts

I have a script to upload multiple jpeg files. It seems to work fine except for large files, when it fails. If I only upload one large file I am able to check the file size and see if it is too big, but once I start the multiple files the scrip just brakes. The $_FILES array doesn't seem to be getting set or something.

I tried print_r($_FILES);

 

If I upload one large file I get:

 

 
Array ( [upload] => Array ( [name] => Array ( [0] => DSC00269.JPG ) [type] => Array ( [0] => image/jpeg ) [tmp_name] => Array ( [0] => /tmp/php6pc0Qs ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 2759482 ) ) ) 

 

If I upload 5 Large files I get:

 

 
Array ( ) 

 

If I upload 5 smaller files I get:

 
Array ( [upload] => Array ( [name] => Array ( [0] => test50.jpg [1] => test50.jpg [2] => test50.jpg [3] => test50.jpg [4] => test50.jpg ) [type] => Array ( [0] => image/jpeg [1] => image/jpeg [2] => image/jpeg [3] => image/jpeg [4] => image/jpeg ) [tmp_name] => Array ( [0] => /tmp/phpFo3PLZ [1] => /tmp/phpz7J9PK [2] => /tmp/phpgVe9SK [3] => /tmp/phph3r6lY [4] => /tmp/php7V1Onq ) [error] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 ) [size] => Array ( [0] => 303108 [1] => 303108 [2] => 303108 [3] => 303108 [4] => 303108 ) ) ) 

 

 

  • 4 weeks later...

So I talked to my hosting company and they told me that I can upload a new php.ini file into my root directory, so I can change the file upload size settings. The technical support person couldn't tell me if I could just put the settings I want to change in this file, or if I need to have a complete php.ini file to do this. So thats my question, can I just put the specific settings or do i need an entire php.ini file. And also where can i find a template for the file? I did find one, but this is my first try at messing with the php.ini, so im not sure if its the right thing.

yeah you do a similar thing with .htacess and then your server will pick up on them and add them to the master list because they are like declaring variables even if one above it was set like

PHP DISPLAY_ERRORS OFF

and then later down you wirte

PHP DISPLAY ERRORS ON

 

the later will rewrite the upper

A great way of learning and finding out if something works or not is to try it yourself, especially when it involves computers and programming.

 

Why ask something in a forum and wait around for hours or days for a reply when you can try it yourself and get almost immediate results. What could be hurt by trying settings in a file. Either the file and the settings work or they don't. As long as you are not doing something that could delete data or files, there is little risk and if we assume that you are following good data and file backup practices, even code that could delete data or files is safe to try.

PFMaBiSmAd,

 

Im sorry you feel like I am wasting peoples time or something, however I did try it, and did see changes when i looked at the phpinfo().  I like to make sure i am doing things correctly, and know why I am doing them. Just because something seems to work doesn't mean it is the right way, or that it will always work. Your comment was unnecessary as the topic has already been solved. Do you contribute anything constructive, or just make people afraid to ask questions? (rhetorical question by the way, think about it)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.