简体   繁体   English

Blazor 上传文件问题

[英]Blazor upload file issue

I'm writing a blazor server app that will sit in the adobe marketplace我正在编写一个 blazor 服务器应用程序,它将位于 adobe 市场

I want to upload a file through the app and place it on a server我想通过应用程序上传文件并将其放在服务器上

When I call the standard code for uploading a file, I get the following exception当我调用上传文件的标准代码时,出现以下异常

''' '''

FileStream fs = File.Create(path);
await file.OpenReadStream().CopyToAsync(fs);
fs.Close();

''' '''

"An error occurred while reading the remote stream: TypeError: r.arrayBuffer is not a function" “读取远程 stream 时发生错误:TypeError:r.arrayBuffer 不是函数”

I iBrowserFile onjetc has data and I can create a buffer with the correct bytes I can create a placeholder on the server but cannot add the stream to the path Ive created我的 iBrowserFile onjetc 有数据,我可以用正确的字节创建一个缓冲区我可以在服务器上创建一个占位符但不能将 stream 添加到我创建的路径中

if I run the app outside of adobe, it uploads just fine如果我在 adobe 之外运行该应用程序,它会上传得很好

I cant find anything related to this error, is there any other way to upload a file?我找不到与此错误相关的任何内容,还有其他上传文件的方法吗?

This may not fully answer your question, but a related GitHub issue indicates a low RAM issue.这可能无法完全回答您的问题,但相关的GitHub问题表明内存不足问题。 In my case, this issue was present on older iPads but newer iPads did not have this issue.就我而言,这个问题出现在旧版 iPad 上,但新版 iPad 没有这个问题。 As this happens over SignalR, this is most likely lack of browser support for handling the file.由于这种情况发生在 SignalR 上,这很可能是因为浏览器不支持处理该文件。

My only solution I could find was to not support the old version of iOS that is causing this.我能找到的唯一解决方案是不支持导致此问题的旧版本 iOS。

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

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