Thanks to @younishd and @fabienwang
I have improved my file upload and the extension variable