Download file, open it locally, edit and then upload

只谈情不闲聊 提交于 2019-12-21 21:25:42

问题


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:

  • Signed Applets

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 (File 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.

  • A desktop application

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.


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


回答1:


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.



来源:https://stackoverflow.com/questions/19645836/download-file-open-it-locally-edit-and-then-upload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!