简体   繁体   English

MEANJS如何将csv发送给用户

[英]MEANJS how to send csv to user

I'm using MEANJS to do a node app. 我正在使用MEANJS做一个节点应用程序。

Basically I have JSON stored in Mongo that I am using json-csv (NPM module) to get out to csv. 基本上,我在JSON中存储了JSON,我正在使用json-csv (NPM模块)来访问CSV。 I was able to get it to download (via a button) locally by doing a couple of tricks. 通过一些技巧,我能够从本地下载(通过按钮)。 But, when I uploaded it to azure it pooped on me. 但是,当我将其上传到天蓝色时,便大便了。 I rolled back everything and now I don't have the code to post here... but, it didn't really work anyway since I need it to run in azure. 我回滚了所有内容,但是现在我没有代码可在此处发布...但是,由于我需要使其在天蓝色的环境下运行,因此它实际上并没有起作用。

If anyone had some guidance or pointers I would really appreciate it. 如果有人有指导或指点,我将不胜感激。

You can store your csv in azure blob and provide users link to the blob. 您可以将csv存储在azure blob中,并为用户提供指向该blob的链接。

BTW, you may still need authentication so a proper solution is providing users a link belonging to your sites and when users click the link, validate auth then redirect to azure blob links. 顺便说一句,您可能仍然需要身份验证,因此一种适当的解决方案是为用户提供属于您站点的链接,并且当用户单击该链接时,请验证身份然后重定向到azure blob链接。

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

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