Unable to set form's "name" on file upload #22
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The FileItem object set the alias to "file", and there is no easy way to change this. This makes it impossible to have a general backend that can determine action of the uploaded file based on the "name=file" form data.
I currently have to file drop's on my view, each with a distinct role. But, both are uploaded with a name of "file", so I don't know which is which.
Suggest adding an actual "name" input to the ng2-file-drop that can override the "alias" field for that item.
actually what I did to get by this was change
(click)="item.upload()"to
(click)="item.alias = newname; item.upload()"just pass newname through your component classThx @adeteejay. I ended up just using a custom tokenized upload URL, instead of worrying about the field name. It worked cleaner for my situation, but I like the simplicity of your solution.
I made PR to fix this problem, I hope guys will merge it :)
I also have this problem.