Open File from History/See File Content

Hi,

before recovering a certain file it would be interesting to see if it is the right version of this file to recover. Therefore, I just wanted to have a look at the file before recovering it or overwriting it.

Is there a possibility to open a file and see how it looks like? In case we have a *.txt file or *.png there are normally default programs assigned for a certain file type and a file from History could be opened with it.

I don’t see a possibility right now, so could anybody explain how this is done normally and maybe if there is really no integrated option right now, is there a plugin that provides this functionality?

Hello and welcome!

No, there is no mechanism to preview a file before restoring. I would instead restore the file to a temporary location (so as not to overwrite the existing file). Once restored you can view the file in the temporary location and decide if you want to overwrite the one in the normal location.

Hello drwtsn32,

thank you very much for the information. I did it the way you suggested, but it was more complicated and therefore not as “user friendly” as expected.

Is there a way to add a Plugin or extend the Duplicati User Interface and implement this functionality somehow? I could also imagine to integrate a File Comparison Tool like WinMerge to compare differences between 2 versions of files - would at least be nice :slight_smile:

The local database only contains metadata, not any actual file contents, so there’s no hope of generating a preview without Duplicati doing a restore operation for the file you want to preview.

If a restore has to be done, might as well just restore to a different directory and then use the preview tool of your choice (or a diff tool like you mention).

You can always submit your idea to the Github page if you want!

Yes, the idea would be to restore a file to a temporary location “somewhere”, let’s say in the Browser-Cache or maybe a specified directory like a Temp-Directory. From there a file from the Timeline/History could very easily be displayed/opened just with one Button-Click. So, yes the file has to be restored from History first, but for a user a Button-Click so open the file would be much better than specifying a directory first and configure everything for every File version she possibly wants to resotre and then opend it from this directory.

Technically yes, we have to restore it, but regarding usability a quicker and easier way would be preferrable.

Further to what @drwtsn32 said there is an enhancement request on GitHub to add a file history in the recovery window but it’s not ready yet. Side note for all you code cowboys out there, there is a nice $280 bounty on that request.

To simplify restores to an alternate location until we get a history view, here are my suggestions.

  1. Create an easily accessible folder to perform the restore into. Something like “C:\RestoredFiles” is great, nice and easy to find with a short path. A less optimal choice would be to make that folder on your “Desktop”, now because your Desktop folder is probably located in “C:\Users%username%\Desktop” , so that new folder would be “C:\Users%username%\Desktop\RestoredFiles”. Sure you can access the files either way but the first way involves less browsing and it restores the files to a location outside of the current users profile (handy if restoring files for another user account).
  2. Clean the folder out once your restore is complete and you’ve moved your data to it’s proper location. This way you’re always restoring to an empty folder.
  3. IMO restoring to an alternate location is much safer overall, I do alt restores regardless of which backup software I’m using. By creating a second copy in another location you can test/open the file while keeping what you currently have. If it’s not the one you wanted, delete it from the restore folder and try again from a different days backup. Once you know for certain that the restored copy is what you want, just manually move it (Copy, Paste, Overwrite) into place.

What would open it? Does this require manual setup to mimic how the OS was set to open files?

How to Customize Your Default Apps in Windows and macOS Want to make sure photos open in Photoshop, web pages open in Chrome, and text files open in Word? You can control which app launches when you open a file on a Windows PC or Mac. Here’s how to set your default apps.

(and don’t forget about Linux, and little NAS boxes, and others)

Some web browsers appear to come close to what’s being requested, and I “think” Duplicati has a way to open web browser pages. In very tiny testing, Firefox did quite nicely when I gave it a file:// URL to use.

Change what Firefox does when you click on or download a file

Open with: Saves the file to a temporary folder and opens it in the operating system’s default application for that file type.

Chrome didn’t do quite as quick a job IMO, but it got there. I haven’t researched its documented behavior.

The @JimboJones plan sounds workable. It does take a little typing, but restore to a short folder name, then have File Explorer sitting on that folder ready for a click on the one file that shows up for preview.

The use-the-browser plan is maybe the next step up, and might reduce the amount of reinventing done…

I’m going to change topic category from Support to Feature. I hope that’s OK. Maybe it’ll get comments. Broad interest is only half of it though. Feature additions require developers to volunteer to develop them.

Wouldn’t a simple link like the following already be sufficient to open the File in the default App of the OS?

<a href="file:///C:\Users\OXO\.duplicati\TempRecoveryFolder\TestDocument.doc">Behind_A_Button</a>

So, a simple Link in the Recovery Page or a Button “View file” would be good for the beginning. For “unknown Files” my browser also shows a dialog box to select the application to open it with.

Just as an idea, I wrote the link as it would be a special folder for Duplicati below the Users-Folder and also with a “TempRecoveryFolder” to temporarily store the Files to show. There are different ways how this could be managed: You could name the Recovered file with its real name and overwrite it in case you want to see the content of different file versions of a file which basically has the same name. Or maybe use the Hash-Key for this File-Version and name this file with this key. But this is not as userfriendly in the end, but left the possibility open to compare two different file versions with a Compare-Tool.

In case a Compare-Tool-Option is also interesting: I know that WinMerge provides a possibility to start with command line arguments that could specify two files to compare. Just thinking, that also a configuration of a Default Compare-Tool with commandline arguments to specify the file versions would be an option.

Default Apps are ususally managed by the OS. In Windows you can easily do it by File-Type and then this should be no problem when a file is opened from a Browser-Link.

Yes, I think this is a simple and sufficient way :slight_smile:

You would need to look at a variety of browsers. I only quoted Firefox claim. One maybe-not-critical point is that browsers might use the internal display of file extensions that they know how to display, such as .pdf.

For cases of browser-internal viewers, there may be a question of how the tabs or windows operate, which sometimes is under user control, for those who know their browser well. For example, does the file preview open in a new tab to the right, replace the Duplicati GUI page (if so, make sure one can get back), pop up a new window (beware of popup blockers, and does this sort of thing require JavaScript), or something else?

I suppose there is also a chance that links (especially for unknown extensions) could use a viewer that’s a different web browser on that system (e.g. if association was set), which would maybe look a little strange.

Although I haven’t tested with an HTML link, testing from the address bar with a file:// link to a local file, then looking around with Process Explorer found both Firefox and Chrome seemingly invoking the external program through Explorer (it’s the parent process of the viewer, and one can see the exact invocation line).

Both programs started the viewer with the original file path, but Chrome downloaded the file first (clutter…) reminding me that a cleanup scheme of some sort would be preferable, if a preview scheme is automated.

Your web development skills seem pretty good, so if you would like to look at code, the HTML part of this is:

https://github.com/duplicati/duplicati/blob/master/Duplicati/Server/webroot/ngax/templates/restore.html

It would be nice if this only needed HTML and JavaScript (maybe AngularJS) work, because it eases finding the right set of developer volunteers to do it. If you want to look into whatever you can do, that would be nice.

Pull requests can be submitted, and community help for any part of Duplicati helps keep the project moving.

Regarding previewing the file, that’s gonna be tough. All depends on too many things, what if you’re using a desktop or a server. The server I use to backup my DWG files will never have AutoCad or the DWG viewer installed nor is there a reasonable way to bundle a web based DWG viewer (if such a think even exists).

What about all my .fbx, .mtl or .blend files? In my mind, there are way too many file types to be able to offer something of value.

If the viewer only supports a few of the file types that I use then it’s not of much use. If the previewer only works for 2 out of 5 file types I use, I’ll just do it manually for all 5 types and move on with life and hope someone put in a checkmark so I can disable the previewer.

If there was a “universal file previewer” that could show all file type data properly that would be incredible but there isn’t!

I get the request and fully understand how helpful it could be to have such a preview but the technical reality is that the scope is just way too big.