Vap0r
Vap0r

Reputation: 2616

Link downloaded file to server

I'm trying to figure out a way to allow a user to download a file from the server and edit it, but when they save, it saves back to the server. I'm looking for a method which doesn't involve things such as flash or silverlight if at all possible.

Upvotes: 6

Views: 145

Answers (5)

shreyas
shreyas

Reputation: 1420

try using google drive. They synchronize local copy to sever. Understanding it may help u

Upvotes: 0

rubo77
rubo77

Reputation: 20845

If you just want the user to be able textfiles that are on your server, you could use a javascript editor like codemirror. CodeMirror lets you edit the file in the browser and supports program language syntax-highlighting.

Here is a Demo:
http://codemirror.net/demo/complete.html

or use TinyMCE if you want to hace a Userfriendly WYSIWYG editor:
http://www.tinymce.com/

Upvotes: 0

Markus Unterwaditzer
Markus Unterwaditzer

Reputation: 8244

As others have said, once a user downloads a file from your server, you have no control about what he does with it. You have other possibilities:

  • Don't make the user download the file, but rather show an editor inside the website. This is often possible without Flash/Silverlight, but the (usually JavaScript-based) editors available are often relatively primitive compared to their desktop counterparts, unless you're dealing only with plain text files.

  • Tell the user to upload the file again after he modified it. Less intuitive, but also less hassle for you.

Upvotes: 2

Denys Séguret
Denys Séguret

Reputation: 382150

You can't do that. If the document is downloaded for local edition by a local software, it must be voluntarily uploaded by the user.

If that weren't the case, that would be a security breach, as the browser doesn't have to see (and doesn't see) the local files and isn't notified of changes.

Now, if we don't look for a general and easy solution, but accept some collaboration from the user, what do we have ?

  • webdav is commonly used for shared directories on enterprise wan. This web based protocol allows the sharing of documents and many softwares, among them OpenOffice and MsOffice, are able to work with webdav. This protocol is supported by all recent OS, I think.

  • some Document Management Systems (among them KTDMS which I've used in the past) install native (windows) hooks on your computer enabling you to send back the document from the software you use (mainly MsOffice). Those DMS generally also offer standard webdav access in order to be compatible with any OS

Upvotes: 2

mcv
mcv

Reputation: 4429

You want the saved version to be automatically uploaded to the server? If you let them download it to their desktop and edit it there, you have no control over what happens to it, how they edit it, and whether they will upload it.

If you want something editable by users while remaining on the server, have them edit it through a web app on the server. Like Google Docs and so many similar cloud services.

Whether that's viable at all depends on course on what kind of file it is and what kind of editor you need to edit it. Plain text is relatively easy. Some proprietary format isn't.

Upvotes: 0

Related Questions