I try to attach data and time with a file name, but it does not work without errors:
$date = date('Y/m/d H:i:s'); $pdf = $date.'order_sheet.pdf';
The file did not load using this code
You use slashes and spaces in the file name, this is not a good idea. Try replacing them with another char, for example:
$date = date('Y_m_d-H-i-s');
it will have special characters and a space in the file name, which is not allowed. This may be the reason. You must use a timestamp instead of a date and time.
you cannot use / in file name