$location = $file_path . $file_name; //header("Content-Disposition: attachment; filename=".strip_tags(stripcslashes($orginal_name) ) . " "); header("Content-Disposition: attachment; filename=\"" . $orginal_name . "\""); // use 'attachment' to force a download header("Content-length: " . $file_size); header("Content-type: " . $file_type); readfile($location); die; break; default: //if no cv has been upload then take them to add new cv screen if ($total_max_cv <= 0 && $action != "add") { redirect_to(BASE_URL . "curriculum_vitae/add/"); } //list of cover letter $my_cvs = CVSetting::employee_find_all($user_id); //$my_cls = CovingLetter::employee_find_all($user_id); if (is_array($my_cvs) and !empty($my_cvs)) { $cv_t = array(); $i = 1; foreach ($my_cvs as $my_cv) { if ($my_cv->is_defult == 'Y') { //$letter = empty($_POST['txt_letter']) ? $my_letter->cl_text : safe_output( $_POST['txt_letter'] ); } $cv_t[$i]["id"] = $my_cv->id; $cv_t[$i]["fk_employee_id"] = $my_cv->fk_employee_id; $cv_t[$i]["cv_title"] = $my_cv->cv_title; $cv_t[$i]["cv_status"] = $my_cv->cv_status; $cv_t[$i]["no_views"] = $my_cv->no_views; $cv_t[$i]["created_at"] = strftime(DATE_FORMAT, strtotime($my_cv->created_at)); $cv_t[$i]["modified_at"] = strftime(DATE_FORMAT, strtotime($my_cv->modified_at));