Welcome Guest, Not a member yet? Register   Sign In
BUG: Large file, empty field
#11

[eluser]Alex van der Vegt[/eluser]
edited
#12

[eluser]Alex van der Vegt[/eluser]
It looks like everything is going fine in the log, except the execution times when i upload a large file(15mb) the execution time is only a few seconds more as a small file (2mb).

But when i'm submitting my form i really need to wait a lot more as the log file said.
#13

[eluser]xwero[/eluser]
And you are sure the max_execution_time is the time you added? You can check it quick with ini_get('max_execution_time') if you want more debugging information you can use var_dump(debug_backtrace());

If you can't find the problem after studying those outputs my resources are used up and i can't help you.
#14

[eluser]Alex van der Vegt[/eluser]
I'm sure the max_execution_time is added here is a link to my phpinfo();

Link for phpinfo();

And i'm sure this is correct, because i can upload 15mb files fine when the code is not in ci.

I've tested this with this simple code:
Code:
<?php

$site_name = $_SERVER['HTTP_HOST'];
$url_dir = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
$url_this =  "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];

$upload_dir = "stuff/";
$upload_url = $url_dir."/stuff/";
$message ="";

//create upload_files directory if not exist
//If it does not work, create on your own and change permission.
if (!is_dir("stuff")) {
  die ("stuff directory doesn't exist");
}

if ($_FILES['userfile']) {
  $message = do_upload($upload_dir, $upload_url);
}
else {
  $message = "Invalid File Specified.";
}

print $message;

function do_upload($upload_dir, $upload_url) {

  $temp_name = $_FILES['userfile']['tmp_name'];
  $file_name = $_FILES['userfile']['name'];
  $file_type = $_FILES['userfile']['type'];
  $file_size = $_FILES['userfile']['size'];
  $result    = $_FILES['userfile']['error'];
  $file_url  = $upload_url.$file_name;
  $file_path = $upload_dir.$file_name;

  //File Name Check
   if ( $file_name =="") {
      $message = "Invalid File Name Specified";
      return $message;
   }
   //File Size Check
   //File Type Check
   else if ( $file_type == ".exe" ) {
       $message = "Sorry, You cannot upload any exe  file";
       return $message;
   }

   $result  =  move_uploaded_file($temp_name, $file_path);
   $message = ($result)?"File url <a href=$file_url.>$file_url</a>" :
            "Somthing is wrong with uploading a file.";

   return $message;
}

?&gt;
&lt;form name="upload" id="upload" ENCTYPE="multipart/form-data" method="post"&gt;
Upload Image&lt;input type="file" id="userfile" name="userfile"&gt;
&lt;input type="submit" name="upload" value="Upload"&gt;
&lt;/form&gt;

When i put this code in any controller it isn't working just as the file uploading class.
They are both working fine till a max of 8mb and i really need 15mb working.
#15

[eluser]Vince Stross[/eluser]
have you tried to increase your $config['max_size'] to something above 15mb? As you have it right now it is EXACTLY 15MB. Is your file a litle more than that? try to change that to 20MB...

just a thought - not sure if it holds any merit. Wink
#16

[eluser]Alex van der Vegt[/eluser]
Yes i've tried it also without a max_size but still the same error.
#17

[eluser]einstein[/eluser]
same problem over here
#18

[eluser]Fatih[/eluser]
Do you have any solution? Please share. Because I have the same problem Sad for CI 1.6.3.
#19

[eluser]Alex van der Vegt[/eluser]
no i don't have a solution. when you want to upload larger files you need to do it outside CI

I'm using CI 1.7 btw
#20

[eluser]Fatih[/eluser]
Mattrick,

I guess the problem is in validation class. Because my code is corrupted in validation check stage. I said to use version 1.6.3 of CI -I mean the ex validation class-, the problem is exist.

It should be a solution in CI. Please help us...




Theme © iAndrew 2016 - Forum software by © MyBB