Welcome Guest, Not a member yet? Register   Sign In
v4.4.4 download not working, v4.1.1 does work
#1

Code:
public function file_view($year, $employee_number, $file_type) {


        if ($employee_number != 0) {
            $wellnessModel = new \App\Models\WellnessAttestationModel();
            $result = $wellnessModel->findLastYears($employee_number, $year);
        } else {
            $benefitProgramModel = new \App\Models\BenefitProgramModel();
            $result = $benefitProgramModel->find($year);
        }
        if (empty($result)){
            return "No file to download.";
            die();
        }
        if ($file_type == "CCCL") {
            $file_path = trim($result['Cessation_Completion_Cert_Location']);
        } else if ($file_type == "CPFL") {
            $file_path = trim($result['Cessation_Proof_Enrollment_Location']);
        } else if ($file_type == "PAL") {
            $file_path = trim($result['Physician_Affidavit_Location']);
        } else if ($file_type == "PALF") {
            $file_path = trim($result->Physician_Affidavit_Template_Location);
        } else {
            return false;
        }
        return $this->response->download($file_path, NULL, TRUE);
    }

The code is the same, we have both v4.1.1 and v4.4.4 running using the same server/database - the v4.1.1 will download the file while the v4.4.4 just loads a blank page off the clicked link.  The file is there, the file was uploaded on v4.4.4 (which I was happy about). I checked the logs, no errors. I'm not getting a routing error either.

We did add specific routes (no idea if it matters):
Code:
$routes->group('wellness', static function ($routes) {
    // GET routes, alphabetized
   
    $routes->get('file_view/(:any)', 'Wellness::file_view/$1');
}

Hoping someone has encountered this and I'm just missing something obvious.  This is on a Windows server.
Reply
#2

So, totally my fault. The third parameter was being made into lower case, which then failed on the if statement for comparison returning nothing on the else statement.
Reply
#3

Errors in apache logs or writable/logs?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB