phpjqueryjquery-file-upload

jQuery File Upload by Blueimp: hide existings files


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

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

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


Solution

  • 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.