1
我使用这个表单来选择一个文件,我不知道如何才能得到这个文件在我的PHP函数的路径。Symfony获取文件路径
<form class="dropzone">
<input name="file" type="file" multiple />
</form>
我想要得到的路径,把它放在一个变量,并用它来阅读CSV文件,如:
public function importAction(Request $request)
{
$myFilePath = ''; //what should i do here?
$csv = Reader::createFromPath($myFilePath); // I use it now like this '../path/myFile1.csv'
}
任何帮助,将不胜感激。
这是不完整的解决方案,我不想保存文件,我只是想获得选择路径。 –
您可以使用$ dir变量来获取路径 –