Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Attachment Extension 1.4

1679111214

Comments

  • that would explain it's non-repsponsiveness :) I'm not using any post processing on the thumbs so no problem. May I assume your local install is a windows box? Then it wouldn't matter. If, however, your local install is *nix then I apologize for offending you!

    Well for the time being it's working well. I'll be looking into it a bit later but for now I'm satisfied.
  • edited June 2006
    michael, yes you're right it is a windows box, sorry forgot that. How about making the second file_exists test not for .basename($File['name']) but for the split apart file name with the strtolower extension?

    For JPEG and jpeg to work you need to change around line 152

    from : in_array(strtolower(substr(substr(strstr(basename($File['name']), "."), 1),-3,3)),array('gif','jpg','png')) ) { to: in_array(strtolower(end(explode('.', basename($File['name'])))) ,array('gif','jpg','jpeg','png')) ) {


    and around line 300:

    from: if ($Context->Configuration['ATTACHMENT_DISPLAY_IMAGES'] != true || !in_array($FileExtension, array('gif', 'jpg', 'png')) ) { to: if ($Context->Configuration['ATTACHMENT_DISPLAY_IMAGES'] != true || !in_array($FileExtension, array('gif', 'jpg', 'jpeg', 'png')) ) {
  • yup, that'll work :)

    thanks for taking a look at that
  • doesn't solve the capital letter file extensions problem, tho.
  • Some problem to me. I have tried to setup attachment extension for vanilla 1 pre-release installed on Mac OSX tiger server. The vanilla works fine and the setting process for attachment with setting extension seems to work fine, but the files attached are not uploaded into /uploads folder. For checking purpose, all of the files within vanilla folder (actually the starting folder name was defined as forum instead of vanilla) were permissioned as 777. But still the files are not uploaded into /uploads folder.
  • I got it to work with the above changes. I also noticed that it doesn't work with files that have apostrophes in the file name. It messes up my server. I wonder if there is a way to fix that?
  • I've uploaded version 1.3 with the following changes:

    Version 1.3 - 12.06.2006, Jazzman
    - Updated Lightbox javascript to resize image properly depending on screen dimensions (tnx to Shino!)
    - Changed Lightbox references to images to a relative path instead of absolute
    - Added chmod function for uploaded files (and created thumbnails)
    - Fixed lowercase file extension conversion
  • thanks for releasing the updates so quickly!
  • Warning: getimagesize(/var/www/virtual/agoranime.com/htdocs/uploads/2.1.png) [function.getimagesize]: failed to open stream: Permission denied in /var/www/virtual/agoranime.com/htdocs/extensions/Attachments/default.php on line 350 Warning: getimagesize(/var/www/virtual/agoranime.com/htdocs/uploads/2.1_mini.jpg) [function.getimagesize]: failed to open stream: Permission denied in /var/www/virtual/agoranime.com/htdocs/extensions/Attachments/default.php on line 350 Warning: getimagesize(/var/www/virtual/agoranime.com/htdocs/uploads/3.Cyber-Budget1150252725109.png) [function.getimagesize]: failed to open stream: Permission denied in /var/www/virtual/agoranime.com/htdocs/extensions/Attachments/default.php on line 350 Warning: getimagesize(/var/www/virtual/agoranime.com/htdocs/uploads/4.Cyber-Budget1150252725109.png) [function.getimagesize]: failed to open stream: Permission denied in /var/www/virtual/agoranime.com/htdocs/extensions/Attachments/default.php on line 350 Warning: getimagesize(/var/www/virtual/agoranime.com/htdocs/uploads/5.2_mini.jpg) [function.getimagesize]: failed to open stream: Permission denied in /var/www/virtual/agoranime.com/htdocs/extensions/Attachments/default.php on line 350 I have a problem...
  • Dare i ask what the permissions on the files in question are? And who owns them?
  • http://essayezvanilla.net/gd_test.php < gd enabled I have a problem with : // Version 1.3, chmod if( $this->Context->Configuration['ATTACHMENT_CHMOD'] != "" && file_exists($ $this->ThumbnailPath . $FileName) ) { chmod( $this->ThumbnailPath . $FileName, $this->Context->Configuration['ATTACHMENT_CHMOD'] ); } Notice: Object to string conversion in /var/www/virtual/agoranime.com/htdocs/extensions/Attachments/default.php on line 167 Notice: Undefined variable: Object in /var/www/virtual/agoranime.com/htdocs/extensions/Attachments/default.php on line 167
  • Now i have : // Version 1.3, chmod if( $this->Context->Configuration['ATTACHMENT_CHMOD'] != "" && file_exists($ $this->ThumbnailPath . $FileName) ) { chmod( $this->ThumbnailPath . $FileName, $this->Context->Configuration['ATTACHMENT_CHMOD'] ); } An error occurred while attempting to copy the source image "/var/www/virtual/agoranime.com/htdocs/uploads/12.Cyber-Budget1150253391828.png". Your version of php (4.4.0-3ubuntu2) may not have png support.
  • "file_exists($ $this->ThumbnailPath . $FileName)"

    is that really in the code?
  • Yes... but it's good ? I'have changing and now... An error occurred while attempting to copy the source image "/var/www/virtual/agoranime.com/htdocs/uploads/12.Cyber-Budget1150253391828.png". Your version of php (4.4.0-3ubuntu2) may not have png support. or (jpg) : An error occurred while attempting to copy the source image "/var/www/virtual/agoranime.com/htdocs/uploads/13.060406443593cc9f0ed.jpg". Your version of php (4.4.0-3ubuntu2) may not have jpeg support. 2 errors are deleted... but there is also one error...
  • I also get the same error, but I haven't found any solution. The problem only appears on one server on all the other servers it works fine...
  • edited June 2006
    Create info.php with
    <?php phpinfo(); ?>

    and check which options are enable in your GD options. look for "JPG Support enabled".

    I had to rebuild php with these options:
    ./configure [...] --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir [...]
  • I've already looked there, but:

    GD Support enabled
    GD Version bundled (2.0.15 compatible)
    FreeType Support enabled
    FreeType Linkage with freetype
    T1Lib Support enabled
    GIF Read Support enabled
    JPG Support enabled
    PNG Support enabled
    WBMP Support enabled
    XBM Support enabled

    I don't know where the error comes from...
  • edited June 2006
    After reinstalling vanilla 1 r460 I have maybe the same problem. When I try to attach a picture, I get this error message:
    "An error occurred while attempting to copy the source image ".../uploads/6.test.jpg". Your version of php (5.0.4) may not have jpeg support."

    Php support it. The problem is with permission; the owner wasn't apache (but with a mode of 777, that should have been ok). But even after have changed the owner, the problems continued, and I don't know why:
    " ls -laR uploads/
    uploads/:
    total 22
    drwxrwxrwx 3 apache apache 1024 Jun 20 17:40 .
    drwxrwxrwx 12 apache apache 1024 Jun 20 17:04 ..
    -rwxrwxrwx 1 apache apache 8433 Jun 20 17:06 4.test.jpg
    --w---xrwt 1 apache apache 473 Jun 20 17:10 5.test.gif
    --w---xrwt 1 apache apache 8433 Jun 20 17:40 6.test.jpg
    drwxrwxrwx 2 apache apache 1024 Jun 20 17:04 thumbs"

    I have try it with ['ATTACHMENT_CHMOD'] = ''; and ['ATTACHMENT_CHMOD'] = '0655';
    What mean rwt?

    I "fixed" the problem with ['ATTACHMENT_CHMOD'] = '0777' but I got this permission -r----x--t???
  • hey dinoboff, thanks a lot!!!!
    It works now.

    Thanks, thanks, thanks
  • Well that works, but not like expected. I would like to know how to get the good permissions
This discussion has been closed.