php - White spaces send in my file when downloading -
i using download file function in laravel so:
if(input::get('download')){ return response::download('file_and_path'); }
now download file when press button called: download
. when try open file(e.g docx document), tell me file corrupted , asks me if repair file. when click yes, right file opened. jpg files cant repair that. it'll file damaged. when open files(which stored in downloads folder) in notepad, see there's tab or white space @ start. colleague said try out function: ob_get_clean()
, file not damaged anymore upon downloading. colleague said that's not right solution problem i'm having.
before download function, upload file first. in public/files/
whenever open there, open without problems without ob_get_clean()
.
when var_dump(ob_get_clean());
get: string(1) " "
. tried find out messed code cant seem figure out problem is. in case, there's random tab in code of file, problem be? code way show need direction in problem be.
note:
when use var_dump(obs_get_clean());
in different function of controller, get: string(1) " "
well. thing 2 functions share basic layout view , both defined in routes.php of course.
do have php closings in files? ?>
. of time responsible since after them spaces.
Comments
Post a Comment