|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-12-30 12:35 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Package: *Directory/Filesystem functions
+Package: Built-in web server
-Assigned To:
+Assigned To: cmb
[2020-12-30 12:35 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 10:00:02 2025 UTC |
Description: ------------ I have a directory called "horseisle.swf" which contains an "index.php" the code for which is as follows: <?php # Decide which version to use if($_SERVER['HTTP_USER_AGENT'] == "Shockwave Flash") # Projector { $file = file_get_contents("horseisle_projector.swf"); header("Content-Type: application/x-shockwave-flash"); header("Content-Length: ".sizeof($file)); echo($file); } else { $file = file_get_contents("horseisle_patched.swf"); header("Content-Type: application/x-shockwave-flash"); header("Content-Length: ".sizeof($file)); echo($file); } ?> i do php -S 127.0.0.1:80 but when i goto http://127.0.0.1/horseisle.swf i get told "127.0.0.1:56396 [404]: GET /horseisle.swf - No such file or directory" Test script: --------------- <?php # Decide which version to use if($_SERVER['HTTP_USER_AGENT'] == "Shockwave Flash") # Projector { $file = file_get_contents("horseisle_projector.swf"); header("Content-Type: application/x-shockwave-flash"); header("Content-Length: ".sizeof($file)); echo($file); } else { $file = file_get_contents("horseisle_patched.swf"); header("Content-Type: application/x-shockwave-flash"); header("Content-Length: ".sizeof($file)); echo($file); } ?> Expected result: ---------------- the swf file that meets the criteria on which user agent you are using is uploaded to the client making the request Actual result: -------------- 404 not found error ..