views.py def submit(request): # this function converts txt to csv files. For example abcd.txt is converted into abcd0000.csv and abcd0000.csv is stored in /main/temp/ folder. def download(request): file_path = os.path.join(BASE_DIR, 'main/temp/abcd0000.csv') if os.path.exists(file_path): with open(file_path, 'rb') as fh: response = HttpResponse(fh.read()) response['Content-Disposition'] = 'inline; filename=' +os.path.basename(file_path) return response raise Http404
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)