grazie mille...pero mi puoi spiegare perche fa ext = f.substr(f.lastIndexOf("\.") +1)e non
ext = f.substr(f.lastIndexOf(".") +1) ???

grazie ancora