i need to write a php web service to output file to a Windows client application. I have two choice Byte Array and Streaming. Which one is better and easy to implement in PHP?
Thanks for 开发者_StackOverflow社区your assistance.
How about just....
$file = 'some_file.exe';
$_size = filesize($_file);
header('Content-Type: binary/octet-stream');
header('Content-Length: '.$_size);
header('Content-Disposition: attachment; filename="' . basename($file) . '"; size=" . $_size);
@readfile($file);
Note: see the comment about some issues with binary files, however.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论