Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Please check this space I created base on your needs <a href="http://dev.wadakkir.org/test/" rel="nofollow">http://dev.wadakkir.org/test/</a> </p> <p>this is the structure of the previous space:</p> <ul> <li><a href="http://dev.wadakkir.org/" rel="nofollow">http://dev.wadakkir.org/</a>: My Document root</li> <li><a href="http://dev.wadakkir.org/test/" rel="nofollow">http://dev.wadakkir.org/test/</a> a floder where the link points</li> <li><a href="http://dev.wadakkir.org/test/subF/" rel="nofollow">http://dev.wadakkir.org/test/subF/</a> a folder with many files inside (in my case only two files exists)</li> <li>When browsing <a href="http://dev.wadakkir.org/test/" rel="nofollow">http://dev.wadakkir.org/test/</a> you see the content of <a href="http://dev.wadakkir.org/test/subF/" rel="nofollow">http://dev.wadakkir.org/test/subF/</a> and you can download the files using the link <a href="http://dev.wadakkir.org/test/tst.txt" rel="nofollow">http://dev.wadakkir.org/test/tst.txt</a></li> </ul> <p>is that what you need ?</p> <p>if so I could perform this behavior using the following .htaccess file</p> <pre><code>Options +Indexes RewriteCond %{REQUEST_URI} !^/test/subF/ RewriteRule ^(.*)$ /test/subF/$1 </code></pre> <p>in your case it should be something like:</p> <pre><code>Options +Indexes RewriteCond %{REQUEST_URI} !^/ftp-upload/ RewriteRule ^(.*)$ /ftp-upload/$1 </code></pre> <p>Hope it helps, if not I can still try again :) </p> <p><strong>UPDATE</strong></p> <p>As suggested in my previous comment, following is a fast written gateway to use, you can have a look at <a href="http://dev.wadakkir.org/test/" rel="nofollow">http://dev.wadakkir.org/test/</a> for the execution sample (I'll let it there for some time)</p> <p>following are the source code I used:</p> <p><em>index.php</em></p> <pre><code>&lt;?php require_once 'gateway.php'; echo "&lt;h1&gt;Hello World!&lt;/h1&gt;"; ?&gt; Existing file names are: &lt;ul&gt; &lt;li&gt;01_Content_Of_Test_Folder.png&lt;/li&gt; &lt;li&gt;02_Content_Of_SubF_Folder.png&lt;/li&gt; &lt;li&gt;2ndTst.txt&lt;/li&gt; &lt;li&gt;tst.txt&lt;/li&gt; &lt;/ul&gt; </code></pre> <p><em>gateway.php</em></p> <pre><code>&lt;?php if( !empty($_GET['cf']) ){ $filename = "./subF/".$_GET['cf']; if( is_file( $filename ) ) dwldFunction($filename); else{ // TODO change this to what ever you want die("File not found ($filename)"); } exit(1); } function dwldFunction( $fName ) { // detect mime type $mime = getMime( $fName ); header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: private',false); header('Content-Type: '. $mime ); header('Content-Disposition: attachment; filename="'.basename($fName).'"'); header("Content-Length: " . filesize($fName)); header('Connection: close'); readfile( $fName ); } function getMime( $fName ) { $r = pathinfo($fName); $m ; //TODO: // complete the following list or use //$finfo = finfo_open(FILEINFO_MIME_TYPE); //finfo_file($finfo, $fName); //finfo_close($finfo); // @: http://php.net/manual/en/function.finfo-file.php switch ( $r['extension'] ){ case "pdf": $m = "application/pdf"; break; case "txt": $m = "text/plain"; break; case "png": $m = "image/png"; break; } return $m; } </code></pre> <p>and the <em>.htaccess</em> content is:</p> <pre><code>Options +Indexes RewriteCond %{REQUEST_URI} !^/test/subF/ RewriteCond %{REQUEST_URI} !index.php RewriteCond %{REQUEST_URI} !subF RewriteRule ^(.*)$ /test/index.php?cf=$1 </code></pre> <p>You can download the complete source code from this <a href="http://dev.wadakkir.org/test/subF/full_source_code.zip" rel="nofollow">link</a></p>
 

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