Google Apps 中的 Apache commons 文件上传和进度百分比

发布于 2024-08-12 11:48:11 字数 407 浏览 2 评论 0原文

我正在尝试使用 ProgressListener 更新调用来获取每个文件的完成百分比。文件数量是动态选择和上传的。

public class ProgressListenerImpl implements ProgressListener 

我可以在更新调用中使用“item”参数吗?

update(long bytesRead, long contentLength, int item)

并将它们关联到 UI 中动态创建的每个 iframe?是否有本质上更容易或更简单的替代建议?

该应用程序必须采用托管在 Google App Engine 上的 Java 语言。我没有将文件保存到任何文件系统,而是使用流将数据重定向到 Google 网站。

I am trying to use ProgressListener update call to obtain percentage completion of each file. Number of files are dynamically chosen and uploaded.

public class ProgressListenerImpl implements ProgressListener 

Will I be able to use the "item" parameter in the update call?

update(long bytesRead, long contentLength, int item)

And associate them to each iframe dynamically created in UI? Is there alternative suggestions that are easier or simpler in nature?

The application has to be in Java hosted on Google App Engine. I am not saving files to any filesystem but using the stream to redirect data to Google sites.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

流绪微梦 2024-08-19 11:48:11

在收到整个请求之前,不会调用您的代码 - 所以不,您无法从服务器端监控上传进度。

Your code isn't called until the entire request has been received - so no, you can't monitor upload progress from the server end.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文