Sajid Ahmad
Sajid Ahmad

Reputation: 1144

Can I change the name of a browsed file?

I am using Meteorjs for my application where I selected a file using HTML file tag, and now I want to change or modify the name of the image with some unique characters so that no duplicate file should be inserted in the database, but file name is not changed. It doesn't accept the value assigned.

'change #question_image':function(evt,t){
    var question_image=t.find("#question_image").files[0];
    console.log(question_image.name)
    var name_list=question_image.name.split(".")
    var extension=name_list[name_list.length-1]
    question_image.name="abcdef.png"
    console.log(question_image)
}

Is it possible to change the name of the selected file or is it security violation?

Upvotes: 0

Views: 76

Answers (0)

Related Questions