通过客户从客户端发送请求发送大型文件数据时,同时获取PayloadToolargeError和CORS错误
我正在研究一个具有上传文件功能的项目。该文件的文本数据将通过Axios Post请求发送到后端节点JS服务器,然后上传到数据库。 在使用较小的文件(约4 kb)时,它可以正常工作。但是,当我上传一个大型文件(〜10000 kb)时,我会同时遇到两个错误。 客户端的CORS错误(React JS)。 服务器端的PayloadToolargeError(节点JS)。
-large“>错误:请求实体太大,但它不起作用。
I am working on a project which has an upload file feature. The text data from this file is to be send to the backend Node js server through axios post request and then uploaded to the database.
While using a smaller file (around 4 kb), it is working fine. But when I upload a large sized file (~10000 kb), I am getting two error simultaneously.
CORS error at the client side (React Js).
PayloadTooLargeError at the server side (Node Js).
I tried using the soluyion given in the post: Error: request entity too large, but it is not working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论