Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing CakePHP, MeioUpload, and phpThumb beneath the web root #24

Open
randallj2877 opened this issue Jan 4, 2010 · 2 comments
Open
Labels

Comments

@randallj2877
Copy link

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
Copy link
Author

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...

@ProLoser
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants