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
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 inas_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