Second, you probably already know that your problem is likely session-related, considering the workaround you've tried. Here's the quote from documentation about streaming response body which file download is. In general, it is safer and easier to not stream output.
Therefore, streaming output is off by default. Streaming output and also using sessions requires a good understanding of how session locks work. What it suggests is manual session lock management. Knowing how your application works should lead you to appropriate lock design. And third. There's usually a way to shift the duty of handling a file download to a web-server, basically by sending appropriate header with filename from the proxied application.
In case on nginx it's called X-accel. So you can avoid the hassle of lock management, still having session restricted downloads. I've made a simple CherrPy app with two download options and putted it behind Nginx.
I played with 1. There were three ways:. With 1 and 2 I had minor strange behaviour in both Firefox and Chromium. On fresh Firefox there was no such behaviour. Stack Overflow for Teams — Collaborate and share knowledge with a private group. The value htmlText is the URL to the file. I want to pass this value to window. However, the actual value that has been passed to window. I don't want to "solve" the issue by directly download the file from the ajax function, as it must be generated through the cherrypy.
When you view this content for window. If you want to show the link of the file, you need to open a popup window with empty url and give your ajax result to popup window, like this in your success function of the ajax call;. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. CherryPy is an open-source project, thus, welcoming contributions. If you are interested you may: Fork CherryPy on GitHub here and submit pull-request with your modifications.
Subscribe to the CherryPy users mailing list. View statistics for this project via Libraries. While CherryPy is one of the easiest and most intuitive frameworks out there, the prerequisite for understanding the CherryPy documentation is that you have a general understanding of Python and web development.
If the docs are insufficient to address your needs, the CherryPy community has several avenues for support. The CherryPy maintainers and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.
Learn more. Please follow the contribution guidelines. And by all means, absorb the Zen of CherryPy. Jul 3, Apr 17, Nov 27, Nov 3, Oct 3, Sep 4, Jun 23, Mar 27, Dec 9, Sep 9, Sep 1, Nov 23, Sep 26, Aug 16, Aug 15, Aug 14, Jul 13, Jul 10, Jun 18, Jun 16, May 11, Apr 22, Apr 19, Mar 22,
0コメント