I am following Need a minimal Django file upload example. in view.py there is
newdoc = Document(docfile = request.FILES['docfile'])
newdoc.save
Let say I upload the file xyz.csv
which make newdoc or docfile as
newdoc=xyz.csv
or docfile=xyz.csv
I want to do:
changedoc = xyz.txt
i.e. I want to remove the extension and give it .txt
extension
How I can play with it? I just need to extract the name only not the file itself.