Changes for page Get physical path on server of an attachment
Last modified by Anca Luca on 2021/04/11 17:08
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -xwiki:XWiki. etvc1 +xwiki:XWiki.ThomasMortagne
- ExtensionCode.ExtensionClass[0]
-
- Description
-
... ... @@ -1,5 +3,3 @@ 1 -== Description == 2 - 3 3 The following script is useful in case you need to get full (physical) path of an attachment on server (with file-storage using) - means at which folder & subfolder this file is physically store. In this example, snippet shows how to get path for attachment TestingData.xls attached to a current page. Of course, you can expand this snippet to get full path of attachment from other page or for list of attachments. 4 4 5 5 {{code}} ... ... @@ -14,3 +14,7 @@ 14 14 println (" rezult is = " + rzlt) 15 15 {{/groovy}} 16 16 {{/code}} 15 + 16 +{{warning}} 17 +Keep in mind that what this snippet is accessing a private field (##storageFile##) which might be renamed or modified any time so better not use that in an extension to hope to be stable. 18 +{{/warning}}