mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Added flag in setting to turn pdf attachments on/off. Client side generated pdf is uploaded on send email action. Backend will check for actuall pdf. Added dummy strings to all languages. Added migration.
23 lines
652 B
PHP
23 lines
652 B
PHP
<?php
|
|
|
|
class AjaxController extends BaseController
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public function pdfupload()
|
|
{
|
|
$uploadsDir = storage_path().'/pdfcache/';
|
|
if ($_FILES['fileblob']['error'] === UPLOAD_ERR_OK && $_FILES['fileblob']['type'] === 'application/pdf') {
|
|
$tmpName = $_FILES['fileblob']['tmp_name'];
|
|
$name = $_POST['filename'];
|
|
|
|
$finfo = new finfo(FILEINFO_MIME);
|
|
if ($finfo->file($tmpName) === 'application/pdf; charset=binary') {
|
|
move_uploaded_file($tmpName, $uploadsDir.$name);
|
|
}
|
|
}
|
|
}
|
|
} |