How to get full path of specific folder

From dialogs.FilePicker and after selecting a file, I got the file namely :

file:///home/fedora002/Downloads/ER_CSV1_2018-01-15.csv

On the other hand, how to get full path of Linux mandatory of folder namely ‘Downloads’ :

file:///home/fedora002/Downloads/

in order to attach another file namely e.g. ER_CSV1_2019-10-29.csv next to it ?

| Fedora 31 Workstation KDE of Fedora from Spins | LibreOffice 6.2.8.2-2 |

This question is not quite clear to me but may be:

Sub CurrentFolder()

 GlobalScope.BasicLibraries.loadLibrary("Tools") 
 dim sURL as String
 dim sPath as String

 sURL = DirectoryNameoutofPath(ThisComponent.getURL(),"/")  REM As URL
 sPath = ConvertFromURL(sURL)                               REM As Path 

End Sub

is what you are looking for.

Dear @anon73440385 ,

MsgBox "sURL = " & sURL & CHR(13) & "sPath = " & sPath

sURL = file:///home/fedora002/Documents/LibreOfficeSampleCode
sPath = /home/fedora002/Documents/LibreOfficeSampleCode

Please let me give more information - User downloads a file from web page and Firefox saves such file into this folder,

file:///home/fedora002/Downloads/

And from your code, can you please help?
I’d like to have the results as hereunder:

sURL = file:///home/fedora002/Downloads/
sPath = /home/fedora002/Downloads/