Hello,
I’m testing MaxiGallery and I get an extrange error. If I upload a zip with 3 files ( 300KB ) or individual images, it gets uploaded without problems. But if I upload to the same resource a zip with 52 images ( < 5MB ), I get a CHMOD error:
PHP error debug
Error: chmod() [function.chmod]: No such file or directory
Error type/ Nr.: Warning - 2
File: /home/salapara/public_html/assets/snippets/maxigallery/maxigallery.php
Line: 372
Line 372 source: chmod($mg->path_to_gal.$name,0666);
It cannot be a permissions error because the error does not ocurr always, only with the large zip. My server upload limit is 10MB
Any idea about what can be happening?
Thanks
EDIT: using version 0.5.2
EDIT2: I made this change to script on lines 371-378:
if(move_uploaded_file( $_FILES['file'.$i]['tmp_name'] , $mg->path_to_gal.$name )) {
chmod($mg->path_to_gal.$name,0666);
$handleMessage = $mg->handleFile($name, $modx->db->getRecordCount($rsx));
if ($handleMessage != "") {
$manageOuterTplData['messages'] .= $handleMessage;
$upload_error = true;
}
}
The problem dissapear, but it uploads only 3 images at first time, and zero in a second try and others. It only creates the folder
EDIT3: Same problem with version 0.6, but in version 0.6 there is not error message. A succesfull message is shown but no images are uploaded.
EDIT4: Debugging i’ve detected that there is an error uploading the file, and move_uploaded_file does not work in this case:
if (move_uploaded_file( $_FILES['file'.$i]['tmp_name'] , $mg->path_to_gal.$name )) {
The function returns false, but it seems the file is uploaded because I can get the tmp_name
EDIT5: Testing, testing and more testing... It seems to not be a problem zip related. The problem can be with "large" files. With any file ( zip, jpg... ) larger than 3MB aprox. I get problems. But my question is... why? If my max_upload_size is 10MB, if I have no problems with other scripts ( outside modx )... The problem happens when uploading only one large jpg too (3,6MB), I think it cannot also be a memory allocated problem... I’m going crazy :S
EEEDIT6:
Not working, tried setting:
ini_set(’max_execution_time’,’600’);
ini_set(’max_input_time’,’600’);
ini_set(’memory_limit’,’100’);
ini_set(’post_max_size’,’10’);
ini_set(’upload_max_filesize’,’10’);