Framework: Django Language: Python OS: Ubuntu
For example, let us assume that I have a file "xyz.pdf" at "/home/username/project/". I have a webpage with download button. So if people click on that download button, the file xyz.pdf should be downloaded.
What I have done,
- Created a webpage with download button with href as "download/" (as you all know this url does not matter much)
- it is redirected to urls.py and finds the appropriate view say for example "xyzdownload"
- at xyzdownload I have following code, response = urllib2.urlopen('./project/xyz.pdf') html = response.read()
The error I am getting is unknown url type: ./project/xyz.pdf
Please let me know if you guys need more clarification. Thanks a lot