Merge remote-tracking branch 'refs/remotes/origin/master' into arindam-bug-priority
This commit is contained in:
@@ -172,7 +172,8 @@ class MailController extends Controller
|
||||
}
|
||||
$server->setFlag($cert);
|
||||
$server->setAuthentication($username, $password);
|
||||
$messages = $server->search('UNSEEN', 10);
|
||||
$date = date('d M Y', strtotime('-1 days'));
|
||||
$messages = $server->search("SINCE \"$date\" UNSEEN");
|
||||
$this->message($messages, $email);
|
||||
}
|
||||
}
|
||||
@@ -339,22 +340,19 @@ class MailController extends Controller
|
||||
*/
|
||||
public function get_data($id)
|
||||
{
|
||||
$attachments = \App\Model\helpdesk\Ticket\Ticket_attachments::where('id', '=', $id)->get();
|
||||
foreach ($attachments as $attachment) {
|
||||
header('Content-type: application/'.$attachment->type.'');
|
||||
header('Content-Disposition: inline; filename='.$attachment->name.'');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
$headers = [
|
||||
'Content-type: application/'.$attachment->type.'',
|
||||
'Content-Disposition: inline; filename='.$attachment->name.'',
|
||||
'Content-Transfer-Encoding: binary',
|
||||
];
|
||||
$file = $attachment->file;
|
||||
echo $file;
|
||||
// return response($file)
|
||||
// ->header('Content-Type', $attachment->type)
|
||||
// ->header('Content-Disposition', 'inline; filename='.$attachment->name.'')
|
||||
// ->header('Content-Transfer-Encoding', 'binary');
|
||||
$attachment = \App\Model\helpdesk\Ticket\Ticket_attachments::where('id', '=', $id)->first();
|
||||
if (mime($attachment->type) == true) {
|
||||
echo "<img src=data:$attachment->type;base64,".$attachment->file.'>';
|
||||
} else {
|
||||
$file = base64_decode($attachment->file);
|
||||
|
||||
return response($file)
|
||||
->header('Cache-Control', 'no-cache private')
|
||||
->header('Content-Description', 'File Transfer')
|
||||
->header('Content-Type', $attachment->type)
|
||||
->header('Content-length', strlen($file))
|
||||
->header('Content-Disposition', 'attachment; filename='.$attachment->name)
|
||||
->header('Content-Transfer-Encoding', 'binary');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user