ngx-uploader icon indicating copy to clipboard operation
ngx-uploader copied to clipboard

Change fileName before upload

Open suplik10 opened this issue 9 years ago • 5 comments

Hi, at first time thx for great job :) But i have a question. Is there any way how to change fileName before update? Attribute name on object file i can't change because is read only. I found a solution when we can change file name when adding file to formdata. But its locked in your directive. Have you another solution pls ?

THX!

suplik10 avatar Oct 24 '16 15:10 suplik10

With the v.3.x.x, this is what I tried and still not working. The files are uploaded, but with the original name, and i'd like to add in ID. Any clue?

                let myId = 'test';
                this.files.forEach(function(file) {
                   file.name = file.name.replace(".",  "_" + myId + ".");
                });
                console.log(this.files); //working, the fileName is changed
                const event: UploadInput = {
                    type: 'uploadAll',
                    url: config.loopbackUrlApi + 'containerPhotos/images/upload/',
                    method: 'POST',
                    data: { access_token: accessToken },
                    concurrency: 0
                };
                this.uploadInput.emit(event);

F3L1X79 avatar Jun 09 '17 13:06 F3L1X79

Is it close because changes has been made into the project, or because the defect is too old? (I really need this functionality a year later)

F3L1X79 avatar Nov 13 '17 16:11 F3L1X79

Hi @F3L1X79 its to old, but I'm reopening the issue. I have closed all issues older than 2017. If there is a need for something like this, we will review the issues and hopefully will work on it in future release ;)

retailify avatar Nov 13 '17 16:11 retailify

Thank you a lot for the good work and for maintaining this project.

F3L1X79 avatar Nov 13 '17 16:11 F3L1X79

#370

retailify avatar Nov 14 '17 12:11 retailify