Revision 7681,
655 bytes
checked in by douglasz, 12 years ago
(diff) |
Ticket #3236 - Correcoes para Best Practice: Short Open Tag e Best Practice: Always Quote Array Keys.
|
Rev | Line | |
---|
[7681] | 1 | <?php
|
---|
[5307] | 2 | session_start();
|
---|
| 3 | include 'includes/classes/Download.class.php';
|
---|
| 4 |
|
---|
| 5 | $pathURL = $_GET['arquivo'];
|
---|
| 6 |
|
---|
| 7 | $baseDir = '/tmp/';
|
---|
| 8 | $baseRef = 'true';
|
---|
| 9 |
|
---|
| 10 | $pathFile = str_replace($baseDir , '', $pathURL);
|
---|
| 11 |
|
---|
| 12 | $pathPartes = explode('/', $pathFile) ;
|
---|
| 13 |
|
---|
| 14 | $pathDirFinal = $pathPartes[0];
|
---|
| 15 |
|
---|
| 16 |
|
---|
| 17 | $fileDown = '';
|
---|
[7655] | 18 | for($i = 1; $i < (count($pathPartes)); ++$i){
|
---|
[5307] | 19 | $fileDown = ($fileDown != '') ? $fileDown . '/' : $fileDown ;
|
---|
| 20 | $fileDown .= $pathPartes[$i];
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | $down = new Download($baseDir, $baseRef );
|
---|
| 24 | $down->doDownload($baseDir . $pathDirFinal);
|
---|
| 25 |
|
---|
| 26 | if($down->getSysError() != ''){
|
---|
| 27 | echo $down->getSysDebug();
|
---|
| 28 | echo $down->getSysError();
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 |
|
---|
| 32 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.