The file you are uploading appears to be empty


  -----  
Author Message

RMcGirr83
Member

Tue Oct 24, 2006 2:20 pm   Post subject: The file you are uploading appears to be empty
Hey Thoul,

Using your admin_upload utility and notice every now and then (particularly on smaller images) that the utility will give me the above

traced it to class_auu.php, specifically

Code:

      if( !($this->filesize > 0) )
      {
         $gen->build_error_msg($lang['UPGEN_FILESIZE_LOW']);
         return false;
      }


size of the file is 50 KB fwiw. Any suggestions?

TIA
 

Thoul
Administrator

Wed Oct 25, 2006 3:48 am   Post subject: re: The file you are uploading appears to be empty
I ran into that the other day when working on the new version. In my case, the file was actually too big and the browser didn't upload it to the server because of that. The file size was reported as 0 and that triggered the error. Based on that, I expect that error would trigger any time a file isn't properly uploaded to the server.

I did add some improved checks in the new version that should catch it before that error triggers, so you may want to try that and see if it does any better for you.
 

RMcGirr83
Member

Mon Jun 25, 2007 9:07 am   Post subject: Re: The file you are uploading appears to be empty
Little bump, when uploading without a graphic being selected, the script returns to the same page with no error warning nor uploading/inserting into the db. All other fields are populated.
 

Thoul
Administrator

Mon Jun 25, 2007 1:57 pm   Post subject: Re: The file you are uploading appears to be empty
Hm, interesting. Thanks for pointing that out. Smile I believe I forgot to add a line to throw an error on that.
 

RMcGirr83
Member

Mon Jun 25, 2007 2:08 pm   Post subject: Re: The file you are uploading appears to be empty
bumping so I get notified of an update Smile
 

RMcGirr83
Member

Fri Jun 29, 2007 9:36 am   Post subject: Re: The file you are uploading appears to be empty
another little bump...found this in class_auu.php

Code:


   function run_preprocessor($file_key = 0)
   {
      global $auu, $gen;

      $this->iteration++;
      $this->file_key = $file_key;

      // Get information from upload form.
      $tmp_name      = $auu->var_check('s', $_FILES['uploadfile']['tmp_name'][$file_key]);
      $image_name      = stripslashes($auu->vars['filename'][$file_key]);
      $default_name   = $auu->vars['defaultname'][$file_key];

      $this->tmp_name      = ( $tmp_name != 'none') ? $tmp_name : '';
      $this->upload_name   = $auu->var_check('s', $_FILES['uploadfile']['name'][$file_key]);
      $this->file_type   = $auu->var_check('s', $_FILES['uploadfile']['type'][$file_key], TRUE);
      $this->file_size   = $auu->var_check('i', $_FILES['uploadfile']['size'][$file_key]);

      // Strip any slashes added to the image name.
      // \ is not a valid filename character, so we have to do this.
      $this->image_name   = ( !empty($image_name) )   ? $image_name   : '';
      $this->default_name   = ( !empty($default_name) ) ? $default_name : '';

      $this->tpl = ( !empty($auu->vars['style']) ) ? $auu->vars['style'] : '';

      if( empty($this->upload_name) )
      {
         return NULL;
      }

      // Check for PHP detected upload errors.
      if( version_compare(PHP_VERSION, '4.2.0', '>=') )
      {
         // PHP may have detected any upload errors already. Let's check for it.
         switch( $_FILES['uploadfile']['error'][$file_key] )
         {
            case UPLOAD_ERR_OK:
               break;
            case UPLOAD_ERR_INI_SIZE:
            case UPLOAD_ERR_FORM_SIZE:
               $this->build_error('UPGEN_FILESIZE', $auu->cfg['max_filesize_kb']);
               return NULL;
               break;
            case UPLOAD_ERR_PARTIAL:
               $this->build_error('UPGEN_PART_FILE');
               return NULL;
               break;
            case UPLOAD_ERR_NO_FILE:
               $this->build_error('UPGEN_NO_FILE');
               return NULL;
               break;
         }
      }

      return $gen->run_module_function('do_before_upload');
   }


which has a upgen_no_file error but doesn't seem to be working?

Thanks for any insights into updating Thoul!! Smile
 

RMcGirr83
Member

Sat Jul 07, 2007 7:42 pm   Post subject: Re: The file you are uploading appears to be empty
nudge
 

Thoul
Administrator

Sat Jul 07, 2007 10:24 pm   Post subject: Re: The file you are uploading appears to be empty
Sorry, I missed that post. That error only triggers if you're using a very recent PHP version. You might have a slightly older version.

I'm glad you brought this up, though. Looking into it pointed out a few things in the PHP manual I had missed before that could also be related to this kind of thing.
 

RMcGirr83
Member

Sat Jul 07, 2007 11:14 pm   Post subject: Re: The file you are uploading appears to be empty
PHP Version 4.4.4

What is strange is that I get an error for other things but not this...using the medals module fwiw.
 

RMcGirr83
Member

Wed Jul 25, 2007 12:58 pm   Post subject: Re: The file you are uploading appears to be empty
just a tiny nudge...anything further on this Thoul?
 

Page 1 of 3
Go to page 1, 2, 3  Next
Display posts from previous: