将Excel文档上传到React并存储在数据库中 [英] Uploading excel document to React and storing in database

查看:76
本文介绍了将Excel文档上传到React并存储在数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个项目中,我希望用户能够通过我的React前端上传excel文件.我需要将上载文档的数据存储在数据库中,以便可以访问它以获取不同的图形以及用于更改数据量的算法.我正在使用PostgreSQL,React,Django,restful api和PostgreSQL.关于如何执行此操作的任何信息都将很棒.谢谢.

I am working on a project where I would like users to be able to upload an excel file through my react frontend. I need the uploaded document's data to be stored in a database so I can access it for different graphs and for an algorithm to change the data amounts. I am using PostgreSQL, React, Django, restful apis, and PostgreSQL. Any info on how to do this would be great. Thanks.

推荐答案

您将无法直接在Postgres中执行此操作.您能做的最好的就是将二进制数据存储在bytea字段中,然后将其拉出以在其他程序中查看/操作,例如Excel,LibreOffice.然后保存在该程序中,并返回到Postgres.您可能需要重新考虑自己想要的东西.

You will not be able to do that directly in Postgres. The best you can do is store the binary data in a bytea field and then pull it out for viewing/manipulating in some other program e.g. Excel, LibreOffice. Then save in that program and push back to Postgres. You may need to rethink what you want.

这篇关于将Excel文档上传到React并存储在数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆