Created
January 8, 2010 13:04
-
-
Save wowo/272036 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class dummyActions extends sfActions | |
{ | |
/** | |
* remember: never use readfile function here! it sends headers to browser, so those sent by you are useles | |
* also don't echo file and then return sfView::NONE - echoing should be done in views! | |
* | |
* this method is environment independent, you can use it in _prod, _dev etc, | |
* alsoWeb Debug Toolbar can be turned on | |
*/ | |
public function executeShowPictureInBrowser(sfWebRequest $request) | |
{ | |
$filepath = '/tmp/photo.jpg'; | |
$this->getResponse()->setContentType('image/jpeg'); | |
return $this->renderText(file_get_contents($filepath)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment