如何使用表单加载csv文件和分隔符?

I try to load my csv delimiter from a php form with the post method.

 $delimiteur=Trim(stripslashes($_POST['delimiteur'])); 
 $files= Trim(stripslashes($_POST['files']));
 $fichier = new SplFileObject($files);         //ouverture du csv
 $fichier->setFlags(SplFileObject::READ_CSV);  // lecture csv
 $fichier->setCsvControl($delimiteur);         //delimiteur csv

but its not working. sorry if my question seems stupid but I do not understand why we can not chager of variable

how to load csv file and the separator with a form? splfilobject does not allow this kind of thing?