Web Designer. Upload file and change name with same extension


1IM 8.1

On my form I created Upload file node. 

I need only change name file but save file extension. 

How I can get the file extension of uploaded file? 

  • Need create 3 string function in module or component.

    1)  FullFileName() 

    select filename from FileUploadLocalCollection

    2) GetFileName()

    Substring(FullFileName(), 0, Indexof(FullFileName(), ".", 0))

    3) GetExtension()

    Substring(FullFileName(), Indexof(FullFileName(), ".", 0), )

    After can use this functions in format filename 

    format("C:\inetpub\wwwroot\IdentityManager\Doc\{0}-{1}{2}",GetFileName(),FormatDate(getdate(), "dd-MM-yyyy-hhmmss"),GetExtension())