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

145791014

Comments

  • good work hutstein (but not tried it).

    First question: I've not got time to look at it in detail at the moment but can tell you where to look. In the last update Jazzman added a whole set of error-handling checks. Look at the beginning of function CreateThumb around line 176. You're obviously getting the third error message. You're getting the big picture because Jazzman added a line in GetAttachmentsString to check if the thumbnail exists - if not it shows the main image.

    Second question: You mean the ATTACHMENT_ALLOWED_FILETYPES array, I guess? The upload and the matching against file type is handled by vanilla in Framework.Class.Uploader.php (the error message you get is from there). If you take out GIF you can't upload gif images with a .GIF file extension in capital letters. The file and the thumbnail is saved on the server with the extension in lower case using strtolower.
  • I found the error: it's in line 171
    if( $ImageType = "jpg") $ImageType = "jpeg";
    this must be
    if( $ImageType == "jpg") $ImageType = "jpeg";
  • jaaaaaa hutstein, es funzt :))
  • edited June 2006
    Wow! hutstein! Nasty typo you found!! Tnx!! I've immediatly changed it! I've also added new filetype icons which jakob provided me (from www.famfamfam.com).

    I've uploaded a new release: version 1.2c

    I'm still thinking about how to get a relative path in the Lightbox javascript, because this:
    $Head->AddScript('blah.js?root=' . urlencode($this->Context->Configuration['WEB_ROOT']))
    doesn't work... The Vanilla class rejects it and returns '0'
  • Hi there. Finally managed to download and install Vanilla 1.0 and am testing the new extension. Will display thumbnails but not large versions of the images. The permissions on uploaded images and files are set to 600 (cannot be viewed directly in the browser). Thumbnails are set to 644 Any clues? Thanks
  • If I turn lightbox and thickbox off and click on the created thumb, get message Forbidden You don't have permission to access /mik2/uploads/5.bmvlogo.gif on this server.
  • Well if it cant be viewed in the browser how do you expect to view it?
  • This is the point - for some reason, as the file is being uploaded, the permissions are being set incorrectly. The directory is writeable (obviously) but the file is not being given read or write permissions to other. Any suggestions?
  • Oh. I see. Sorry i was a bit mixed up. Assuming apache has ownership of the file it should be alright actually. Have you tried recursively setting the upload dir to 644?
  • Curious - my FTP client won't let me alter the permissions for the /uploads/thumbs dir or the files in the /uploads directory. Maybe some kind of ownership issue?? Not an expert at all this!
  • Yeah that makes sense. If apache has ownership you wont be able to do anything.

    Strange how you're the first guy to experience this though. It's up to jakob/jazzman i guess.
  • ithcyithcy New
    edited June 2006
    i'd talk to your host. it sounds like a default permissions issue. maybe your system has an overly restrictive umask.

    what are the permissions of the /uploads folder and who's the owner of /uploads and /uploads/thumbs?
  • Sometimes, when using scripts that upload files via browser, I've witnessed that ownership of upload folders and files created changes hands to apache. Briefly reading through only the last few comments, I think that's probably what happened. If you have an option with your ftp client, see if you have an option to see "owner/group" fields on the remote host, this will tell you everything.
  • I use Vanilla's Uploader class for uploading images. I think Mark is still struggling with file permissions (read on his Swell blog). I could cheat and add chmod to manually change file permissions, but I think it would be better if Mark implements it into the Framework.
  • I think you want to do a chown back to the default owner rather than allowing apache or whatever user the files/folders are being assigned to. Keep chmod at the standard 644 to prevent any potential malicious activity :)
  • Ownership appears the same, but I cannot change the files in any way -rw-r--r-- 1 dbrazil dbrazil 6978 Jun 1 13:09 account.php drwxr-xr-x 2 dbrazil dbrazil 4096 Jun 1 13:09 ajax drwxr-xr-x 2 dbrazil dbrazil 4096 Jun 1 13:09 appg -rw-r--r-- 1 dbrazil dbrazil 2220 Jun 1 13:09 categories.php -rw-r--r-- 1 dbrazil dbrazil 6277 Jun 1 13:09 comments.php drwxrwxrwx 2 dbrazil dbrazil 4096 Jun 1 13:12 conf -rw-r--r-- 1 dbrazil dbrazil 4284 Jun 1 13:04 debug.php -rw-r--r-- 1 dbrazil dbrazil 1851 Jun 1 13:04 extension.php drwxr-xr-x 34 dbrazil dbrazil 4096 Jun 1 13:47 extensions -rw-r--r-- 1 dbrazil dbrazil 18009 Jun 1 13:10 gpl.txt -rw-r--r-- 1 dbrazil dbrazil 2494 Jun 1 13:04 index.php drwxr-xr-x 2 dbrazil dbrazil 4096 Jun 1 13:04 js drwxr-xr-x 4 dbrazil dbrazil 4096 Jun 1 13:07 languages drwxr-xr-x 5 dbrazil dbrazil 4096 Jun 1 13:03 library -rw-r--r-- 1 dbrazil dbrazil 2366 Jun 1 13:04 people.php -rw-r--r-- 1 dbrazil dbrazil 2519 Jun 1 13:07 post.php -rw-r--r-- 1 dbrazil dbrazil 2021 Jun 1 13:01 readme.html -rw-r--r-- 1 dbrazil dbrazil 2105 Jun 1 13:01 search.php -rw-r--r-- 1 dbrazil dbrazil 7602 Jun 1 13:04 settings.php drwxr-xr-x 2 dbrazil dbrazil 4096 Jun 1 13:01 setup -rw-r--r-- 1 dbrazil dbrazil 2667 Jun 1 13:01 termsofservice.php drwxr-xr-x 3 dbrazil dbrazil 4096 Jun 1 13:08 themes drw-r--r-- 3 dbrazil dbrazil 4096 Jun 1 14:35 uploads Tries a different FTP client and it would not even allow me to open the uploads folder!
  • Will try creating a different folder and changing the upload location in the attachment settings Will let you know if that helps
  • Nope - still the same issue...
  • what about ownership of the files inside the folder though?
  • -rw------- 1 dbrazil dbrazil 2719 Jun 1 15:21 6.face01.jpg -rw------- 1 dbrazil dbrazil 5510 Jun 1 15:23 7.image.jpg -rw------- 1 dbrazil dbrazil 275413 Jun 1 15:26 8.gallery-final size.jpg drwxrwxrw- 2 dbrazil dbrazil 4096 Jun 1 15:26 thumbs These are the uploaded images in the new /files dir All seem to be owned by me but permissions wrong. inside thumbs: -rw-r--r-- 1 dbrazil dbrazil 3940 Jun 1 15:21 6.face01.jpg -rw-r--r-- 1 dbrazil dbrazil 4000 Jun 1 15:23 7.image.jpg -rw-r--r-- 1 dbrazil dbrazil 4406 Jun 1 15:26 8.gallery-final size.jpg permissions set ok. Will keep trying...
This discussion has been closed.