<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -780,6 +780,7 @@ EOD;
 		}
 
 		$location = get_post_meta($entry['ID'], '_wp_attached_file', true);
+		$location = get_option ('upload_path') . '/' . $location; 
 		$filetype = wp_check_filetype($location);
 
 		if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
@@ -789,11 +790,19 @@ EOD;
 		header('Content-Type: ' . $entry['post_mime_type']);
 		header('Connection: close');
 
-		$fp = fopen($location, &quot;rb&quot;);
-		while(!feof($fp)) {
-			echo fread($fp, 4096);
+		if ($fp = fopen($location, &quot;rb&quot;)) { 
+			status_header('200'); 
+			header('Content-Type: ' . $entry['post_mime_type']); 
+			header('Connection: close');
+
+			while(!feof($fp)) {
+				echo fread($fp, 4096);
+			}
+
+			fclose($fp);
+		} else {
+			status_header ('404');
 		}
-		fclose($fp);
 
 		log_app('function',&quot;get_file($postID)&quot;);
 		exit;</diff>
      <filename>wp-app.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fbe5e94e96919fce5163a3714d11fe12e5f94db6</id>
    </parent>
  </parents>
  <author>
    <name>westi</name>
    <email>westi@1a063a9b-81f0-0310-95a4-ce76da25c4cd</email>
  </author>
  <url>http://github.com/blowery/wordpress/commit/1ce7e21152837a294dadad8854af9deff1d88209</url>
  <id>1ce7e21152837a294dadad8854af9deff1d88209</id>
  <committed-date>2009-08-13T13:47:13-07:00</committed-date>
  <authored-date>2009-08-13T13:47:13-07:00</authored-date>
  <message>Enable the APP attachment file download to work correctly rather than just returning a lot of php notices. Fixes #10372 for 2.8 branch props mysz.

git-svn-id: http://svn.automattic.com/wordpress/branches/2.8@11811 1a063a9b-81f0-0310-95a4-ce76da25c4cd</message>
  <tree>abbc8cce102b348a486c51bb3e8d0e79e9d3e85c</tree>
  <committer>
    <name>westi</name>
    <email>westi@1a063a9b-81f0-0310-95a4-ce76da25c4cd</email>
  </committer>
</commit>
