mar10 / wsgidav

A generic and extendable WebDAV server based on WSGI

Home Page:https://wsgidav.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add properties to virtual file

aghster opened this issue · comments

Hi @mar10

Thank you for this great tool! I managed to use it to make data stored in a database accessible as a virtual filesystem that is mounted as a windows network drive. And it wasn‘t even very difficult, thanks to wsgidav!

But there is one thing I fail to achieve that would be very useful to me. I want to add to every virtual file provided by my custom DAVProvider a property derived from data stored in the database so that I can sort the virtual files in Windows Explorer by that property. Is this possible? Could you give me a hint on how to achieve this?

I tried defining get_property_names and get_property_value as in wsgidav/samples/virtual_dav_provider.py. But the properties I define in this manner seem not to be recognized by Windows Explorer, since they do not show up when I right-click a file and select Properties and then the Details tab.

Any advice will be much appreciated. Thanks!

You could try to set this setting to true, in order to enable file time support in File Explorer

hotfixes:
    #: Handle Microsoft's Win32LastModifiedTime property.
    #: This is useful only in the case when you copy files from a Windows
    #: client into a WebDAV share. Windows sends the "last modified" time of
    #: the file in a Microsoft extended property called "Win32LastModifiedTime"
    #: instead of the standard WebDAV property "getlastmodified". So without
    #: this config option set to "True", the "last modified" time of the copied
    #: file will be "now" instead of its original value.
    #: The proper solution for dealing with the Windows WebDAV client is to use
    #: a persistent property manager. This setting is merely a work-around.
    #: NOTE: Works with Win10, can't work with Win7. Other versions untested.
    emulate_win32_lastmod: false

However I don't think that File Explorer supports arbitrary WebDAV dead properties.
This answer seems to back that: https://stackoverflow.com/a/67164981/19166
You probably need a special WebDAV client for that.

(Please let me konw if you find out otherwise).