Note that there are some explanatory texts on larger screens.

plurals
  1. POError in file download
    primarykey
    data
    text
    <p>Hi every one i am trying a secure file downlaod but i dont know what is issu, why my code could not find the file here is code, it always shows "File Not found"</p> <p>This is DOWNLOAD.php</p> <pre><code>&lt;?php require('wp-config.php'); $file = $_GET['filename']; $sql = "Select * From wp_paypal_responders Where att_secure = '$file'"; $qry = mysql_query($sql); $obj = mysql_fetch_object($qry); $fileName = $obj-&gt;att_secure; $download_dir = $_SERVER['HTTP_HOST'].'/uploads/'; $fullPath = $download_dir.$fileName; // Required for some browsers if(ini_get('zlib.output_compression')) ini_set('zlib.output_compression', 'Off'); // File Exists? if( file_exists($fullPath) ){ header("Content-Disposition: attachment; filename=".$fullPath); header("Content-Description:File Transfer"); header('Content-Transfer-Encoding: binary'); header('Cache-Control:must-revalidate, post-check=0, pre-check=0'); header('Pragma:public'); header('Content-Type: application/octet-stream'); readfile( $fullPath ); } else die('File Not Found'); ?&gt; </code></pre> <p>and This is Index.php</p> <pre><code>&lt;table class="widefat posts" cellspacing="0" style="margin-top:20px;"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th scope="col" width="30%"&gt;&lt;a href="javascript:;"&gt;Responder&lt;/a&gt;&lt;/th&gt; &lt;th scope="col" width="30%"&gt;&lt;a href="javascript:;"&gt;From&lt;/a&gt;&lt;/th&gt; &lt;th scope="col" width="20%"&gt;&lt;a href="javascript:;"&gt;Subject&lt;/a&gt;&lt;/th&gt; &lt;th scope="col" width="35%"&gt;&lt;a href="javascript:;"&gt;Attachment&lt;/a&gt;&lt;/th&gt; &lt;th scope="col" width="10%"&gt;&lt;a href="javascript:;"&gt;Edit&lt;/a&gt;&lt;/th&gt; &lt;th scope="col" width="10%"&gt;&lt;a href="javascript:;"&gt;Delete&lt;/a&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tfoot&gt; &lt;tr&gt; &lt;th scope="col" width="30%"&gt;&lt;a href="javascript:;"&gt;Responder&lt;/a&gt;&lt;/th&gt; &lt;th scope="col" width="30%"&gt;&lt;a href="javascript:;"&gt;From&lt;/a&gt;&lt;/th&gt; &lt;th scope="col" width="20%"&gt;&lt;a href="javascript:;"&gt;Subject&lt;/a&gt;&lt;/th&gt; &lt;th scope="col" width="35%"&gt;&lt;a href="javascript:;"&gt;Attachment&lt;/a&gt;&lt;/th&gt; &lt;th scope="col" width="10%"&gt;&lt;a href="javascript:;"&gt;Edit&lt;/a&gt;&lt;/th&gt; &lt;th scope="col" width="10%"&gt;&lt;a href="javascript:;"&gt;Delete&lt;/a&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/tfoot&gt; &lt;tbody&gt; &lt;?php $sql = "SELECT * FROM $table"; $results = $wpdb -&gt; get_results($sql); ?&gt; &lt;?php if( !empty( $results ) ) : ?&gt; &lt;?php foreach( $results as $result ): ?&gt; &lt;tr&gt; &lt;td&gt;&lt;?php echo $result -&gt; resp_name; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $result -&gt; from_email; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $result -&gt; subject; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="&lt;?php echo get_bloginfo('siteurl'); ?&gt;/download.php?filename=&lt;?php echo $result -&gt; att_secure; ?&gt;"&gt;&lt;?php echo $result -&gt; att_name; ?&gt;&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="admin.php?page=file&amp;action=update&amp;id=&lt;?php echo $result -&gt; id; ?&gt;"&gt;Update&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="admin.php?page=file&amp;action=delete&amp;id=&lt;?php echo $result -&gt; id; ?&gt;"&gt;Delete&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php endforeach; ?&gt; &lt;?php else: ?&gt; &lt;tr&gt; &lt;td colspan="5"&gt;No Responders&lt;/td&gt; &lt;/tr&gt; &lt;?php endif; ?&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload