简体   繁体   English

Meteor.js应用程序的离线图像上传

[英]Offline image upload for Meteor.js app

There is a Meteor.js app, which is suppose to stay fully functional in offline mode. 有一个Meteor.js应用程序,该应用程序可以在脱机模式下保持完整功能。 This app enables users to upload their images and use those images to create content within the app. 该应用程序使用户可以上传其图像,并使用这些图像在应用程序内创建内容。

Question - how to approach image upload in the Meteor.js app, so that the app stays fully functional in offline mode? 问题-如何在Meteor.js应用程序中处理图像上传,以使该应用程序在脱机模式下保持完整功能?

My thoughts so far: 到目前为止,我的想法是:

--There is Meteor Offline Data project, but it is still very much work in progress, and it only works for text content: https://github.com/awwx/meteor-offline-data -有流星脱机数据项目,但仍在进行中,并且仅适用于文本内容: https : //github.com/awwx/meteor-offline-data

--In offline, when adding the image in the app, I could detect offline mode and utilize HTML5 File API for using the image locally -在离线状态下,当在应用程序中添加图像时,我可以检测到离线模式并利用HTML5 File API在本地使用图像

--When online is detected, the image is uploaded to the server behind the scenes -当检测到在线时,图像被上传到后台服务器

--In online content with images is downloaded to the app and saved for offline usage using App Cache -在带有图片的在线内容中,使用App Cache将图片下载到应用程序并保存以供离线使用

There are still many things unclear, so any hints are appreciated at this point. 仍有许多事情尚不清楚,因此在此感谢任何提示。

You may want to try collectionFS, https://atmosphere.meteor.com/package/collectionFS , as it make a client side collection that the file is added to. 您可能要尝试使用collectionFS, https://atmosphere.meteor.com/package/collectionFS ,因为它会创建一个将文件添加到的客户端集合。 The clientside collection should sink when the internet reconnects. 互联网重新连接时,客户端收集应该下沉。

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

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