In your Zend form, create a file element:
$element = new Zend_Form_Element_File('fileElement');
Then you can insert the downloaded image into your database in BLOB format as follows:
$conn = new PDO("mysql:host='host';dbname='database'", 'userName', 'password');
$imagePath = $zendForm->fileElement->getFileName();
$image = file_get_contents('$imagePath');
$sql = "INSERT INTO images (data) values(?)";
$q = $conn->prepare($sql);
$q->bindParam(1, $image, PDO::PARAM_LOB);
$q->execute();
source
share