Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions not filtered #224

Closed
trueflywood opened this issue Feb 28, 2017 · 6 comments
Closed

Extensions not filtered #224

trueflywood opened this issue Feb 28, 2017 · 6 comments

Comments

@trueflywood
Copy link

Extensions not filtered when autoUpload: true,

@lukasz-galka
Copy link
Contributor

I have checked all your bugs #222 #223 #224 and everything is working fine for me. Could you give more info?

@trueflywood
Copy link
Author

trueflywood commented Mar 1, 2017

#222 could not be reproduced. Perhaps after reinstalling packages.

#223, #224

options:

this.options = new NgUploaderOptions({
            filterExtensions: true,
            allowedExtensions: ['jpg', 'png'],
            url: this.backendService.serveUrl + 'api/units/' + this.id + '/photo',
            authToken: this.cookieService.get('access_token'),
            fieldName: 'content'
        });

HTML:

 <div class="image" >
                            <div class="drag-n-drop-container"
                                 ngFileDrop
                                 [options] = "options"
                                 [events]="inputUploadEvents"
                                 (onUpload)="handleUpload($event)"
                                 [ngClass]="{'file-over': hasBaseDropZoneOver}"
                                 (onFileOver)="fileOverBase($event)"
                                 (beforeUpload)="beforeUpload($event)"
                                 (onUploadRejected)="handleUploadRejected($event)">
                                <label class="upload-button">
                                    <input type="file"
                                           class="hidden"
                                           ngFileSelect
                                           [options] = "options"
                                           (onUpload)="handleUpload($event)">
                                    +
                                </label>
                            </div>
                        </div>

the function "handleUploadRejected" not called and file upload to server.

if autoUpload: false, and start downloading via events, file with restricted extensions are not loaded.
The function "handleUploadRejected" not called.

@lukasz-galka
Copy link
Contributor

you are right, I was checking ngFileSelect

@charbonnier666
Copy link

still doesn't works with 2.2.5 ( I try with file zip but browse not filtered (all extension) and I can upload anything)

@charbonnier666
Copy link

Edit: it doesn't upload not-zip files but it doesn't filter in browse

@scottlepp
Copy link

@charbonnier666 you can just use the "accept" attribute on the input tag: https://www.w3schools.com/tags/att_input_accept.asp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants