Welcome Guest, Not a member yet? Register   Sign In
BUG: Large file, empty field
#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.


Messages In This Thread
BUG: Large file, empty field - by El Forum - 03-11-2008, 08:42 AM
BUG: Large file, empty field - by El Forum - 03-11-2008, 09:46 AM
BUG: Large file, empty field - by El Forum - 03-11-2008, 10:46 AM
BUG: Large file, empty field - by El Forum - 03-11-2008, 01:58 PM
BUG: Large file, empty field - by El Forum - 03-11-2008, 02:13 PM
BUG: Large file, empty field - by El Forum - 03-11-2008, 02:15 PM
BUG: Large file, empty field - by El Forum - 03-11-2008, 02:26 PM
BUG: Large file, empty field - by El Forum - 03-11-2008, 02:34 PM
BUG: Large file, empty field - by El Forum - 03-11-2008, 04:18 PM
BUG: Large file, empty field - by El Forum - 03-12-2008, 04:30 AM
BUG: Large file, empty field - by El Forum - 03-12-2008, 04:30 AM
BUG: Large file, empty field - by El Forum - 03-12-2008, 04:38 AM
BUG: Large file, empty field - by El Forum - 03-12-2008, 05:11 AM
BUG: Large file, empty field - by El Forum - 03-12-2008, 05:22 AM
BUG: Large file, empty field - by El Forum - 03-12-2008, 07:09 AM
BUG: Large file, empty field - by El Forum - 03-12-2008, 08:12 AM
BUG: Large file, empty field - by El Forum - 07-14-2008, 08:23 PM
BUG: Large file, empty field - by El Forum - 01-09-2009, 09:35 AM
BUG: Large file, empty field - by El Forum - 01-09-2009, 09:47 AM
BUG: Large file, empty field - by El Forum - 01-09-2009, 09:52 AM
BUG: Large file, empty field - by El Forum - 01-09-2009, 10:09 AM
BUG: Large file, empty field - by El Forum - 01-12-2009, 03:38 AM
BUG: Large file, empty field - by El Forum - 01-12-2009, 04:41 AM
BUG: Large file, empty field - by El Forum - 01-12-2009, 05:26 AM
BUG: Large file, empty field - by El Forum - 01-12-2009, 07:11 AM
BUG: Large file, empty field - by El Forum - 01-12-2009, 07:52 AM
BUG: Large file, empty field - by El Forum - 01-12-2009, 09:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB