Announcement

Collapse
No announcement yet.

File extension has an extra dot.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] File extension has an extra dot.

    For some reason when users upload files, they are getting an extra dot appended to the extension. For example if the file name is image.ai, it will show up on the site as image..ai file1.pdf will show up as file1..pdf

    When the files are downladed to the user's local machine, they still have two dots in the extension, however they open fine with whatever program they are associated with.

    This is a new vb4 installation that was imported from IPB. The old files imported fine without this extension anomoly, but all new files that are uploaded have this extra dot. This is file system based storage, not database. Any ideas?
    Anybody who says "it can't be done" will usually be interrupted by somebody who is already doing it.

  • #2
    Hello,

    This is a known bug.

    Please read the bug report here: http://www.vbulletin.com/forum/proje...?issueid=36400

    This bug is marked as fixed in 4.0.3 and you can apply a temporary fix with the code as shown by Darren towards the bottom of the first page of that link.
    To be updated...

    Comment


    • #3
      For the sake of others and not having to repeat the bug link over and over:

      Here is the fix as written by Darren Gordon

      Originally posted by Darren Gordon

      Fixed in 4.0.3

      Fix:

      includes/class_upload.php OLD
      Code:
           function ncrencode_filename($filename)
      {
          $extension = file_extension($filename);
          $base = substr($filename, 0, strpos($filename, $extension));
          $base = ncrencode($base);
      
          return $base . '.' . $extension;
      }
      includes/class_upload.php NEW
      Code:
           function ncrencode_filename($filename)
      {
          $extension = file_extension($filename);
          $base = substr($filename, 0, (strpos($filename, $extension)-1));
          $base = ncrencode($base, true);
      
          return $base . '.' . $extension;
      }
      Query:
      Code:
           ALTER TABLE attachment CHANGE filename filename VARCHAR(255) NOT NULL DEFAULT '';
      To be updated...

      Comment


      • #4
        Thanks for the info. I'm a bit blurry eyed from the 48 hour upgrade right now. I should have checked the bug tracker before I posted.
        Anybody who says "it can't be done" will usually be interrupted by somebody who is already doing it.

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X