时间:2020-10-22 22:26:00 | 栏目:Python代码 | 点击:次
如下所示:
filename=None if request.method == 'POST' and request.FILES.get('file'): from django.core.files.storage import FileSystemStorage myfile = request.FILES['file'] fs = FileSystemStorage() filename = fs.save(myfile.name, myfile)