无法通过 Chrome 将 JSON 文件上传到 Firebase 数据库
Failing to upload JSON file through Chrome to Firebase Database
这真是令人沮丧。我有一个 104 MB JSON 文件,我想通过 Web 前端上传到我的 Firebase 数据库,但是经过一段随机的时间(我已经计时,它不是恒定的,从 2 到 20 秒不等) 我收到错误:
There was a problem contacting the server. Try uploading your file again.
所以我再次尝试,但一直失败。我以前上传过差不多这么大的文件,实时数据库中存储数据的限制是1 GB,
我什至还差得远。为什么一直上传失败?
这是我在 chrome 开发工具中遇到的错误:
Failed to load resource: net::ERR_CONNECTION_ABORTED
https://project.firebaseio.com/.upload?auth=eyJhbGciOiJIUzI1NiIsInR5cCI6…Q3NiwiYWRtaW4iOnRydWUsInYiOjB9.CihvjvLSlx43nOBynAJeyibkBRtygeRlG4Yo1t3jKVA
Failed to load resource: net::ERR_CONNECTION_ABORTED
如果我单击错误中显示的 link,它是一个包含 POST request required
.
字样的页面
原来答案是完全忽略网络导入器并使用 firebase-import。第一次运行完美,只用了一分钟就上传了整个 json。它还具有合并功能。
使用 firebase-import
作为建议接受的答案,我收到错误:
Error: WRITE_TOO_BIG: Data to write exceeds the maximum size that can be modified with a single request.
但是,使用 firebase-cli
我成功地 删除了我的整个数据库:
firebase database:remove /
它似乎会自动遍历您的数据库树以查找小于限制大小的请求,然后自动执行多个删除请求。这需要一些时间,但绝对有效。
您还可以通过 json 文件导入:
firebase database:set / data.json
我不确定 firebase database:set
是否支持合并。
这真是令人沮丧。我有一个 104 MB JSON 文件,我想通过 Web 前端上传到我的 Firebase 数据库,但是经过一段随机的时间(我已经计时,它不是恒定的,从 2 到 20 秒不等) 我收到错误:
There was a problem contacting the server. Try uploading your file again.
所以我再次尝试,但一直失败。我以前上传过差不多这么大的文件,实时数据库中存储数据的限制是1 GB,
我什至还差得远。为什么一直上传失败?
这是我在 chrome 开发工具中遇到的错误:
Failed to load resource: net::ERR_CONNECTION_ABORTED
https://project.firebaseio.com/.upload?auth=eyJhbGciOiJIUzI1NiIsInR5cCI6…Q3NiwiYWRtaW4iOnRydWUsInYiOjB9.CihvjvLSlx43nOBynAJeyibkBRtygeRlG4Yo1t3jKVA
Failed to load resource: net::ERR_CONNECTION_ABORTED
如果我单击错误中显示的 link,它是一个包含 POST request required
.
原来答案是完全忽略网络导入器并使用 firebase-import。第一次运行完美,只用了一分钟就上传了整个 json。它还具有合并功能。
使用 firebase-import
作为建议接受的答案,我收到错误:
Error: WRITE_TOO_BIG: Data to write exceeds the maximum size that can be modified with a single request.
但是,使用 firebase-cli
我成功地 删除了我的整个数据库:
firebase database:remove /
它似乎会自动遍历您的数据库树以查找小于限制大小的请求,然后自动执行多个删除请求。这需要一些时间,但绝对有效。
您还可以通过 json 文件导入:
firebase database:set / data.json
我不确定 firebase database:set
是否支持合并。