AngularJS FileSaver producing empty file
问题 I have the following PHP code which outputs a document from a web service: $db->where('documentReference', $post->documentID); $results = $db->getOne('documents'); $filelocation = 'doc/'; $file = $results['filename']; header('Content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document'); header('Content-Length: ' . filesize($filelocation.$file)); header('Content-disposition: attachment; filename="'.$file.'"'); readfile($filelocation.$file); And on the front end..