php - File download blocks everything -
i downloading file following code:
header('content-description: file transfer'); header('content-type: application/octet-stream'); header('content-disposition: attachment; filename="' . $new_filename . '"'); header('content-transfer-encoding: binary'); header('connection: keep-alive'); header('expires: 0'); header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('pragma: public'); header('content-length: ' . $size); readfile($download_url); exit; where $download_url file path. file downloading perfect can't download next file on same page while first downloading or navigate other pages until download complete or canceled.
found answer here. had close session before outputting file.
session_write_close(); readfile($download_url); the session can opened 1 php process @ time, , other requests issue session_start() command block while waiting access session data file.
Comments
Post a Comment