下载文件,在本地打开,编辑后上传 [英] Download file, open it locally, edit and then upload

查看:23
本文介绍了下载文件,在本地打开,编辑后上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Web 应用程序,可以让用户正常下载文件,然后他们可以使用简单的上传机制(从目录和内容中选择文件)上传它们.

I have a web application that let users download files normally, and then later they can upload them using a simple upload mechanism (choose the files from directory and stuff).

这是我想要做的:在我的应用程序上有一个编辑"按钮,下载文件并从用户的本地驱动器自动打开它.然后我想检查是否有更改,将其上传回服务器.或者,提供一种方法让用户轻松上传.

Here's what I want to do: to have and "EDIT" button on my app, that download the file and open it automatically from the user's local drive. Then I want to check if there are changes, to upload it back to the server. Or, provide a way to the user upload it easily.

到目前为止,我的选择是:

The options I've come so far, are:

  • 签名小程序

我发现小程序缓慢且丑陋".但到目前为止,这是获胜的选择.它可以轻松下载和打开文件,然后有一个上传按钮,可以将文件放回服务器.

I find applets slow and "ugly". But it's the winning choice so far. It could download and open the file easily and then have an upload button, to put the file back on the server.

  • HTML 5(文件 API)

我开始研究这个并喜欢我所看到的.但是我看到的很多东西都是本地上传,拖放之类的.我对这项技术很陌生,我不知道它是否可行.

I started looking into this and liked what I saw. But a lot of things that I saw are for local uploads, drag and drop and this kind of stuff. I'm very new to this technology and I simple don't know if it's doable.

  • 桌面应用

我不喜欢这个,但它仍在桌子上.它可以监视由小程序创建的目录(这里又是),检查是否有更改,然后将其上传回服务器.

I don't like this one but it's still on the table. It could one that monitors a directory created by an applet (here it's again), check if there are changes and then upload it back to the server.


有人可以为我提供一些帮助吗?如果可以用 HTML 5 做类似的事情,或者有更好的解决方案.


Can someone provide me some help? If a can do something like that with HTML 5 or if there's a better solution.

推荐答案

即使您尝试使用 HTML5,您也无法在 HTML 中没有用户交互的情况下上传文件.这违背了网络基本原理.用户必须以某种方式触发文件上传,拖放,浏览和选择文件等.由于部署的痛苦,签​​名小程序可能是比桌面应用程序更好的解决方案.如果您希望用户编辑的这个文件只是基于文本的,我建议您使用基于 HTML 的编辑器,例如 Google 为 Google 文档所做的.

You can't upload files without user interaction in HTML even if you try HTML5. That's against web fundemantals. The user has to trigger the file upload in a way, drag&drop, browse and select file, etc. Signed applets might be a better solution than a desktop application because of the pain of the deployment. If this file that you want your users to edit is just text based, I suggesst using an HTML based editor like Google does it for Google Docs.

这篇关于下载文件,在本地打开,编辑后上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆