【发布时间】:2021-07-08 12:03:20
【问题描述】:
home.html
<form action="" method="POST" enctype="multipart/form-data">
{% csrf_token %}
<input type="file" name = 'img' >
<button type="submit"> Post On Facebook </button>
</form>
views.py
def home(request):
if request.method == 'POST':
# get the image absolute location
return render(request,'home.html')
我想要文件路径,以便我可以使用 GraphAPI 将文件上传到 Facebook。
【问题讨论】:
-
你应该在任何教程或官方文档中找到它。所以最好找一些教程,你会比在 Stackoverflow 上提问更快地获得解决方案。