MeioUpload icon indicating copy to clipboard operation
MeioUpload copied to clipboard

Implementing CakePHP, MeioUpload, and phpThumb beneath the web root

Open randallj2877 opened this issue 15 years ago • 2 comments

I've got everything but the app/webroot directory of CakePHP beneath the web root -- in other words, inaccessible to the web. I've placed the phpthumb package in CakePHP's vendors directory, also inaccessible to the web. Meioupload uploads files to a directory I've manually created beneath the web root, and I'm trying to create thumbnails.

Meioupload has no problem uploading a file to a directory beneath the web root, but when it comes time for thumbnail creation, I think phpthumb is having a hard time seeing the uploaded file there (the source file below the web root that it needs to convert to thumbnails). I keep getting the following error described in the phpthumb FAQ:

Q: I'm getting " does not exist" when I know the file does exist A: Check that these two values are present and properly configured in phpThumb.config.php (introduced in v1.6.0): $PHPTHUMB_CONFIG'allow_src_above_docroot' $PHPTHUMB_CONFIG'allow_src_above_phpthumb' If your images are outside DOCUMENT_ROOT (this includes if you have an image upload form, most likely the images will get uploaded to "/tmp/" or similar) then you will have to configure 'allow_src_above_docroot' to true. Make sure whatever user the webserver is running as has read permission to the file/directory you're reading from

I have set $PHPTHUMB_CONFIG['allow_src_above_docroot'] to 'true', but that doesn;t help me...Also, the source directory (beneath the web root) is chmod 0755, so no problem there...I still get the error...

Does Meioupload, and subsequently the core CakePHP files, have to be installed above the web root, with phpthumb also above the web root -- in the CakePHP vendors directory, for thumbnail creation to work correctly?

randallj2877 avatar Jan 04 '10 12:01 randallj2877

Does Meioupload, and subsequently the core CakePHP files, have to be installed above the web root, with phpthumb also above the web root -- in the CakePHP vendors directory, for thumbnail creation to work correctly?

In addition to that, does the MeioUpload uploads directory have to be above the web root as well (for thumbnail creation to work)? I see that the thumbnails directory is automatically created above the web root...

The bottom line is that, per security requirements for my current project, I have to have "at least" the MeioUpload uploads directory beneath the web root...It doesn't matter so much that the thumbnails are above the web root, since the thumbnails are not the original uploaded files...

randallj2877 avatar Jan 04 '10 12:01 randallj2877

I have a working environment with this setup used in conjunction with media views that seems to work flawlessly. Unfortunately I am too lazy to fish it out for you lol.

ProLoser avatar Jan 14 '10 12:01 ProLoser