简体   繁体   English

使用Python在后台下载文件

[英]Downloading files in background with Python

I have got a working web application in Python that downloads a file into the web server upon a user's request. 我有一个Python工作的Web应用程序,可以根据用户的请求将文件下载到Web服务器中。 This works fine for small file downloads but when the user requests a larger file, the connection times out. 这适用于小文件下载,但当用户请求更大的文件时,连接超时。 So, I think I need to process the download in the background but I'm not sure what tool is most suitable for this. 所以,我认为我需要在后台处理下载,但我不确定哪种工具最适合这个。 Celery seems to be right but I don't really want it to be queued(the download must start immediately). Celery似乎是对的,但我真的不希望它排队(下载必须立即开始)。 What would you suggest? 你会建议什么?

Timout duration is up to you, you could just make it longer. Timout持续时间取决于你,你可以让它更长。

Anyway there are plenty of flash or AJAX uploaders out there, nothing you can do only server side AFAIK 无论如何,那里有很多flash或AJAX上传器,你只能做服务器端 AFAIK

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM