我试图了解当前是否有任何方法可以从网络客户端进行可恢复上传(例如上传到 Google Cloud Storage 存储桶)。看看 FileReader 它看起来不可能(对于大文件)。我错过了什么吗?
最佳答案
您可能需要查看 Cloud Storage 官方文档以了解可断点上传,无论是 JSON API或XML API 。您基本上需要在第一个 HTTP 请求中向 Storage 请求一个可恢复的 session URI,并在第二个请求中实际将文件上传到该 URI,例如通过 jQuery 的 ajax 方法。
您会发现,在请求可恢复 session URI 时,您需要通过不记名 token 对您的请求进行身份验证。如 this SO answer 中所述:
You'll either need to have your customers use their own Google credentials (unusual, but makes sense for a third party tool for managing someone else's Google Cloud resources) or use some form of signed URL or similar feature.
关于javascript - 可以从客户端 JavaScript 恢复上传吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50088748/