用Django和python上传文件?

2024-03-29 14:50:44 发布

您现在位置:Python中文网/ 问答频道 /正文

    <input type="file" name="doc-file" multiple/>

   file_path = request.FILES.get('doc-file')

文件路径的返回值是None

但是当我做file_path = request.POST.get('doc-file')时,它返回filename。用python和django上传文件的最佳方式是什么?你知道吗


Tags: 文件pathname路径noneinputgetdoc