Código php:
Ver original
<?php class download { var $files = 1; function download($path) { $this->path = $path; } function getMimetype() { return (!$this->checkMimetype()) ? 'application/force-download' : $this->mimeTypes[$this->fext]; } function checkMimetype() { } function get($req) { $this->fname = $this->parts['basename']; $this->type = $this->getMimetype(); $this->_send(); } function _send() { } function _type($file) { } function select($name = 'files', $label = '', $curr = '', $chars = 30) { $select = '<form method="post" action="'.$_SERVER['PHP_SELF'].'">'."\n"; $select .= ($label != '') ? '<label for="'.$name.'">'.$label.'</label>'."\n" : ''; $select .= '<select name="'.$name.'" id="'.$name.'">'."\n"; $select .= ($curr == "") ? " <option value=\"\" selected>...\n" : "<option value=\"\">...\n"; $array[] = $file; } foreach ($array as $val) { $ext = $this->_type($val); $select .= ' <option value="'.$val.'">'; $this->files++; } } $select .= '</select>' ."\n"; $select .= '<input type="submit" name="download" value="Download" />'."\n"; $select .= '</form>'."\n"; } return ($this->files == 0) ? "No files!" : $select; } } ?>