2
votes

I'm using jquery jQuery File Upload by Blueimp (http://blueimp.github.io/jQuery-File-Upload/) and I have a questio:

I use this plugin to enable user to load files on a web dir but is important that any user can see or delete existings files. How can I hide existings files?

Here my page: http://www.sgagrafica.com/file_uploader2/

Regads Marco

2

2 Answers

5
votes

I have found a solution. In file ../server/php/UploadHandler.php we have this function around line 319

protected function get_file_objects($iteration_method = 'get_file_object') {
        $upload_dir = $this->get_upload_path();
        if (!is_dir($upload_dir)) {
            return array();
        }
        return array_values(array_filter(array_map(
            array($this, $iteration_method),
            scandir($upload_dir)
        )));
    }

Comment or delete this function and any files are shown after user reload page or new userr access to page.

On this way is possible only upload files according to my question.

I hope this will be usefull to someone.

-1
votes
protected function initialize() {
    switch ($this->get_server_var('REQUEST_METHOD')) {
        case 'OPTIONS':
        case 'HEAD':
            $this->head();
            break;
        case 'GET':
            // $this->get($this->options['print_response']); <-- comment this line
            break;
        case 'PATCH':
        case 'PUT':
        case 'POST':
            $this->post($this->options['print_response']);
            break;
        case 'DELETE':
            $this->delete($this->options['print_response']);
            break;
        default:
            $this->header('HTTP/1.1 405 Method Not Allowed');
    }
}