add webcam to customer create/update
This commit is contained in:
@@ -31,7 +31,21 @@ class Image
|
||||
|
||||
return Upload::getLink($fileName);
|
||||
}
|
||||
public static function saveBinary($binary_data, $dir = '')
|
||||
{
|
||||
$fileName = Upload::getUploadPath($dir) . DIRECTORY_SEPARATOR . Upload::genFileName("jpg");
|
||||
|
||||
$uploaded = file_put_contents( $fileName, $binary_data );
|
||||
|
||||
if(!$uploaded){
|
||||
throw new HttpException(500, 'Cannot upload file "'.$fileName.'". Please check write permissions.');
|
||||
}
|
||||
|
||||
return Upload::getLink($fileName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $filename
|
||||
|
||||
Reference in New Issue
Block a user