Changeset 11811 for branches/2.8/wp-app.php
- Timestamp:
- 08/13/2009 08:47:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.8/wp-app.php
r11416 r11811 781 781 782 782 $location = get_post_meta($entry['ID'], '_wp_attached_file', true); 783 $location = get_option ('upload_path') . '/' . $location; 783 784 $filetype = wp_check_filetype($location); 784 785 … … 790 791 header('Connection: close'); 791 792 792 $fp = fopen($location, "rb"); 793 while(!feof($fp)) { 794 echo fread($fp, 4096); 795 } 796 fclose($fp); 793 if ($fp = fopen($location, "rb")) { 794 status_header('200'); 795 header('Content-Type: ' . $entry['post_mime_type']); 796 header('Connection: close'); 797 798 while(!feof($fp)) { 799 echo fread($fp, 4096); 800 } 801 802 fclose($fp); 803 } else { 804 status_header ('404'); 805 } 797 806 798 807 log_app('function',"get_file($postID)");
Note: See TracChangeset
for help on using the changeset viewer.