Jump to content

to big upload files or?...


dennis_gull

Recommended Posts

Hello, when I try to upload a file on my site and its to big it will send me this message on the preview you upload page:

Warning: reset(): Passed variable is not an array or object in /hsphere/local/home/dennisg/ingameauction.com/includes/classes/product_manage.php on line 117Warning: Variable passed to each() is not an array or object in /hsphere/local/home/dennisg/ingameauction.com/includes/classes/product_manage.php on line 118
I think its because it takes to long time to send the data is that true?The code from the error line looks like this:
class objectInfo {// class constructor	function objectInfo($object_array) {	  reset($object_array);	  while (list($key, $value) = each($object_array)) {		$this->$key = tep_db_prepare_input($value);	  }	}  }

Any ideas why this is happening? The file I try to upload is only about 10 mb.

Link to comment
Share on other sites

Hello, when I try to upload a file on my site and its to big it will send me this message on the preview you upload page:I think its because it takes to long time to send the data is that true?The code from the error line looks like this:
class objectInfo {// class constructor	function objectInfo($object_array) {	  reset($object_array);	  while (list($key, $value) = each($object_array)) {		$this->$key = tep_db_prepare_input($value);	  }	}  }

Any ideas why this is happening? The file I try to upload is only about 10 mb.

the errors are telling you that it wants $object_array to be an array but for some reason it isn't an array. take a look at the code where you work with $object_array and double check that it is actually an array
Link to comment
Share on other sites

Well go check to see if the file is bigger than the set limit in Apache/IIS and PHP. In Apache it should be in the httpd.confand in PHP it should be in the php.ini... I believe, other wise you can google for 'max upload size php/apache/IIS'I'll go see what I can turn up.

Link to comment
Share on other sites

so in the php.ini look for or add 'upload_max_filesize integer'Apache times out after 300 secs for sending or receiving data... in httpd.conf the command is 'TimeOut' or something like that.

Link to comment
Share on other sites

thanks dcole.ath.cx but wont I need to have access to the root to change the php.ini file?Im using a webhost at the moment, is there anything I can do then?
there is an ini_set function that you can use in any php file but if you not on your own webhost it is probably blocked. some (not many) webhosts allow a php.ini file in your main directory.
Link to comment
Share on other sites

omg I feel so relieved. I just mailed my host and asked about the max upload size and how to change it (if it was possible) and it took like 3 second for them to answer and they told me to add the data I needed in the htaccess file, for example:php_value post_max_size 50Mphp_value upload_max_filesize 50Mphp_value max_execution_time 1200php_value memory_limit 50M And so I did, and now everything works fine :)I was going crazy over this and it was so easy to fix it, anyways thanks for the help. I wouldn't have been able to figure this out by myself.

Link to comment
Share on other sites

Just to mention, you will want to validate the uploaded file before you try to do anything with it. That way you can display a useful error message to the user instead of the user seeing that you aren't passing an array to reset, that doesn't mean anything to a user. Instead you will want to detect if the file was too large and show an error message saying that. There is more information about that here:http://www.php.net/manual/en/features.file-upload.php

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...