I'm usind django e plotly dash to make a dashboard in my page. In this application we will to make a upload file, but this file have to save in "C:\tmp\Uploads". How can i make this and access with python dash???
I make the form and can make the upload file, but can't access in another module.
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def test_page(request):
if request.method == 'POST':
upload_file = request.FILES['document']
return render(request, 'index.html')
Did you save the uploaded file in "C:\tmp\Uploads"? If not, save the uploaded file in "C:\tmp\Uploads" like below.
Then, read the uploaded(and saved) file in your ploty-dash module. It will works.
References
How to Upload Files With Django
Simply save file to folder in Django