jazzband / django-downloadview

Serve files with Django.
https://django-downloadview.readthedocs.io
Other
374 stars 57 forks source link

StorageDownloadView how to pass a path "as_view" #133

Open maxkeogh opened 7 years ago

maxkeogh commented 7 years ago

Hi, I'm trying to implement StorageDownloadView in my Django site for users to download various types of files. I can set the variables for the type of file and filename depending on the user choices however they are located in different directories. I can define various storage locations and paths each with individual entries in the url file however, this could get a little unmanageable if the number of file types and locations increases. In the documentation it says "The view accepts a path argument you can setup either in as_view or via URLconfs". In my view I can set the storage location and filename depending on the file type but how do I then pass these variable to StorageDownloadView without using a url? Also, I'd like to know if I can serve the file for download and then, if successful, return a render_to_response to a success page. If you can let me have any pointers to put me in the right direction I would be grateful. Many thanks Max