简体   繁体   English

上传文件到 flask

[英]Uploading files to flask

So I have been searching for a clear and complete answer to this with no luck so far.所以我一直在寻找一个明确而完整的答案,到目前为止没有运气。 Hoping someone here can help.希望这里有人可以提供帮助。 I have a web app that I need to be able to have a user upload a file.我有一个 web 应用程序,我需要能够让用户上传文件。 The user puts in an email address to associate with the file and submits both to the server for processing.用户输入 email 地址以与文件关联,并将两者提交给服务器进行处理。 I need it to be able to handle large files so chunking/streaming.我需要它能够处理大文件,以便分块/流式传输。 I was able to get a basic dropzone to work but not with being able to also send the email address at the same time.我能够让一个基本的 dropzone 工作,但不能同时发送 email 地址。 Is there a way to upload files in chunks along with additional data?有没有办法将文件和附加数据一起上传?

It seems as if you are asking for a place to upload files and match them with an email.好像您要找一个地方来上传文件并将它们与 email 匹配。 This can be done with a simple HTML form.这可以通过一个简单的 HTML 表格来完成。 All you need is an upload button and email address box, but you can include whatever else you want as well.您只需要一个上传按钮和 email 地址框,但您也可以添加任何您想要的内容。 Please check out my code at my code .请在我的代码中查看我的代码 I think it would be really helpful.我认为这真的很有帮助。

I hope this helps you.我希望这可以帮助你。

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

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