I'm having a problem splitting my file. This is my code for uploading a file.
def upload_file(request):
if request.method == 'POST':
form = UploadFileForm(request.POST, request.FILES)
file = request.FILES['file']
return HttpResponse(str(file) + "is uploaded")
else:
form = UploadFileForm()
return render(request, 'upload.html',{'form':form})
I don't have any idea how to split the file that was uploaded. Like in every 20 lines, it'll split into smaller text files like this: File(1).txt, File(2).txt.... Thanks in advance!