XUpload - Error when removing a not allowed file.

Message
Author
bsprogs
Posts: 11
Joined: Jul 02, 2007 3:20 am

Error when removing a not allowed file.

#1 Postby bsprogs » Sep 12, 2007 4:34 pm

Pilgrim, I've been talking with you via AIM (ItsBsprogs) about the PHP stuff I'm working on using XUpload Pro.
While testing every possible scenario I could think of, I found a glitch in the uploader.

Here are my current XUploadConfig.pm settings that I'm using:

Code: Select all

 1 =>
   {
      # Directory for uploaded files
      target_dir      => '/home/username/public_html/cgi-bin/uploads', # enter your target dir here

      # URL to send all input values from upload page
      url_post        => 'http://www.domain.com/index.php?a=upload', # post URL should be here

      # Max number of upload fields
      max_upload_files => 20,

      # Minimum/Maximum Total upload size in Kbytes (leave empty or zero to disable)
      min_upload_size => 0,
      max_upload_size => 40960,

      # Minimum/Maximum upload Filesize in Kbytes (leave empty or zero to disable)
      min_upload_filesize => 0,
      max_upload_filesize => 2048,

      # Allowed file extensions delimited with '|'
      # Use '.*' to allow all extensions
      #ext_allowed     => 'bmp|gif|jpg|jpe|jpeg|png|asf|avi|mov|mpeg|mpg|qt|wmv|wmx|zip|tar|gz|rar', # Images only for public uploader
      ext_allowed     => 'bmp|gif|jpg|jpe|jpeg|png',

      # Not Allowed file extensions delimited with '|'
      # Leave it blank to disable this filter
      # ext_not_allowed => 'exe|php|asp|js|asf|avi|mov|mpeg|mpg|qt|wmv|wmx|zip|tar|gz|rar|flv|html|cgi|pm|xhtml|htm|css',
      ext_not_allowed => '',
   },
Here is the problem:

I selected files that were NOT on the allowed list (exe and zip). It gave me the error message as expected saying it can't be uploaded because it's an invalid file type. I selected the text in the browse input box and deleted it, then I pressed tab and it added a blank file to the list of files to be uploaded.

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#2 Postby PilgrimX182 » Sep 14, 2007 7:25 am

Thanks for this glitch! Fixed.

In xupload.js find

Code: Select all

if(value=="")return true;
and replace with

Code: Select all

if(value=="")return false;