rejetto forum

How can we edit and save back existing files

jds711 · 9 · 3689

0 Members and 1 Guest are viewing this topic.

Offline jds711

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
Hi,

Very interested in the concept here of HFS, but struggling a bit with what would be a critical feature for us: editing existing files in a desktop application.

So, we see that we can take the HREF URL from the HFS console and use that within a desktop application (e.g. MS Word for .docx, Notepad for .txt, etc.) to open the file. However, the file opens up read only. Is there any way to open the file with read/write permission? I.e. after the user has edited the text file in Notepad, to save it back to the same file on HFS?

Obviously HFS can write files as it can upload new files... but we don't see how to re-write the existing ones. Is there a way to do this now? If not, is this something that could be readily added (assuming this is a feature that many folks would want) or is there something fundamental in the design that makes this difficult to achieve? And if so, does anyone know of a product that could support that (other than Sharepoint please).

Thanks for your attention; appreciate any replies.


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
My understanding of this post is that:

you have file a being shared in HFS
you have file b open (which is other wise an exact copy of file a)
You want to save file b to file a so hfs can pass it via http?

of are you trying to write to file a and read it as if you were file b?
---------------------------------------------------------------------------
either way, it sounds more like a file permission issue where the files are located.
(if you cant normally write the file, then it won't write.) try give the folder "recursive"/ "inheritance" permission of read and write specifically to the windows "everyone" user...
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 842
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
I think he wants to open a file online, edit it on a desktop app, and save it back online again (like if it were a local file). I mean...

- He has: http://hfs-server.com/MyDocument.doc
- He open that file directly with Microsoft Word
- He edit this file, and hits the save button

He is expecting the file to be "updated" online (automatically) on the HFS-Server (without having to upload it again). It's like a "live" file edition feature...
Is this what you are looking for, jds711?
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
Alright, i can see that leo...

hmm, i recall some iss stuff that could do that, but the easiest implementation would be ftp.

so i would recommend fhfs...

and use the ftp to open and edit and resave the file...
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline jds711

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
Thanks for you replies, much appreciated.

Yes, LeoNeeson has exactly captured what we are trying to do.

To elaborate, we have a large collection of files that are used as part of an application. In the current legacy application that is prototypical Windows desktop executable, the metadata for the files is stored in a database but the files themselves are in CIFS share that each desktop is mounting. When a user clicks on a file listed in the application, the appropriate desktop application - MS Word, MS Excel, MS Outlook, Adobe, Notepad, etc. - is launched with a UNC reference to the file share location as an argument. The user can then of course edit the document in that application 'live' and save the changes.

However this only works - both in terms of how the main legacy app accesses data directly from the database and how the user's PC mounts the CIFS share for the documents - within the office. We are now completely rebuilding/replacing the legacy application to be a mobile application that can run in remote locations and does so within a browser. The database is no longer directly accessed; data is retrieved via a RESTful web service API. Similarly we want to be able to access and edit the files from a server without having to mount them. To access them on a read-only basis, HFS seems to work fine for: we can program our web-app to provide the proper HREF reference to the launched editor application instead of the UNC, and it will properly open and display the file contents, but only read-only  :(. The users need to be able make changes and save them back, which it just doesn't seem to do. We have found the Sharepoint can do this, but their API interface is horrific. We can likely accomplish the goal with it, but with significant complexity and contamination of our code, so if there was a cleaner solution we'd be eager to use it.

bmartino1, you mentioned 2 possible directions to look
1) "iss stuff": could you elaborate on what / where that is?
2) fhfs: would that be able to supply the needed functionality and transparency to users?, i.e. serve out a file based for r/w based on a HREF argument passed to and used by a Windows desktop program?

Of course would be extra cool if HFS could do this out of the box... but I am assuming that even if that was a direction HFS was going in, delivery of this functionality would be a ways off.

Thanks again for your attention.

« Last Edit: December 14, 2015, 06:09:06 PM by jds711 »


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
I haven't dealt with CIFS share in quite a long time...
https://technet.microsoft.com/en-us/library/cc939973.aspx

I'm not familiar with "RESTful web services" I assume it either a web group or other html that you use for implementation
http://www.drdobbs.com/web-development/restful-web-services-a-tutorial/240169069

FTP would accomplish what you are wanting regarding no mount shares, fire write access and other etc..
https://filezilla-project.org/download.php?type=server

First we are going to have to define some things here:

FTP is the "FILE" Protocol, so the needed file write and read implementation is already there with in ftp access...
https://en.wikipedia.org/wiki/File_Transfer_Protocol

Http is the "Hyper text / image" Protocol and is meant for read-only scenarios...(it can have write access but it can be hard to implement)
https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol

http vs. ftp:
http://daniel.haxx.se/docs/ftp-vs-http.html

*SO i STRONGLY RECOMMEND Using FTP

HFS in and of itself is the HTTP protocol...

HFS has a modification form one of the forum users, who has done quite a bit of respected work.
(if you chose to continue to use HFS, i would recommend this variation that includes hfs and filezilla....)

Other wise as stated before, there are other programs that do similar with other functionality.
Microsoft ISS / Apache witch also have ftp capabilities....

SO lets go over
FHFS : http://www.rejetto.com/forum/fhfs/version-2-0-0-release-download/msg1060565/#msg1060565
download: http://sourceforge.net/projects/fhfs/files/2.1.x/2.1.3/FHFS%202.1.3%20Install.zip/download

possible helpful setup:
http://www.rejetto.com/forum/fhfs/way-to-change-default-url-root/msg1059177/#msg1059177

if combining filezilla with hfs, so there is a ftp and http protocol.
The only thing that would need to be changed in your setup would be http path that the users are reading to ftp paths, you can then keep the http path for read only purposes...

Microsoft documentation are open files for word / excel...
https://support.microsoft.com/en-us/kb/290142

as regards to what i'm saying for http, there is php ways and other coding way to write to a file, the easiest of which is to open the document with in the web browser so the file never leaves the server. the best example of this would be a google doc, you can create and edit /read/share, the document all on the webpage.
*Implementation of this is extremely complicated but possible.

I recall an ISS Microsoft program for : Internet Information Services
I'm unable to find the site that went over iss implementation of such, but if you chose to go that router, then i would have you look into HTA application programs, I have found that they are Internet Explorer specific...

Info on hta: https://en.wikipedia.org/wiki/HTML_Application
in the past i had an hta run word form my pc through hfs, but was unsuccessful in what i was fully trying to do...  with a lot of programming for it was a bit beyond my scope... So i know it is possible, but i would not recommend what i assume you are trying to do with HTTP....

especial since you can still http reference ftp locations:
Code: [Select]
<a href="ftp://username:password@domain.com/dir/file.txt" rel="nofollow">TextFile</a>
hope this is information and helps you in your endeavors.
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
welcome jds!
i think the best solution for your case is a webdav server.
HFS doesn't support webdav, sorry. It may in the future, but don't hold your breath, you'd better search for an alternative if you want to have it sooner than in 10 years :)


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
that's right, I forgot about WebDAV... :p
https://en.wikipedia.org/wiki/WebDAV


https://community.box.com/t5/Managing-Your-Content/Does-Box-support-WebDAV/ta-p/310

you can create a drop box account / folder, share it with hfs, and webdav to dropbox same with goggle drive
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing