I have a script that should rename a file I uploaded. Goes like this:
If (CStr(Request.QueryString("GP_upload")) <> "") Then
Dim REUF_renameMask
Dim sTS
sTS=sTimeStamp
REUF_renameMask = DoTrim(Session("FirmId"),2)+"_"+DoTrim(Session("QnrId"),2)+ "_"+sTS+"_"+"##name##"+".##ext##"
RenameUploadedFiles pau_thePath, pau_nameConflict, REUF_renameMask
end if
--
All of it works fine other than the sTS portion of it which should add the time stamp. Here is my script for it, which works just fine. Only the timestamp for some reason is not being added. Perhaps the syntax in the rename mask is incorrect?
-- This works fine --
Function GetMmDdYyyyHhMmSs(sDate)
GetMmDdYyyyHhMmSs=""
If sDate="" OR IsNull(sDate) OR IsEmpty(sDate) Then Exit Function
If Not IsDate(sDate) Then Exit Function
Dim sRetVal,sVal
sRetVal=""
sVal=DatePart("m",sDate)
If Len(sVal)=2 Then sRetVal=sVal Else sRetVal="0"&sVal End If
sVal=DatePart("d",sDate)
If Len(sVal)=2 Then sRetVal=sRetVal&sVal Else sRetVal=sRetVal&"0"&sVal End If
sRetVal=sRetVal&DatePart("yyyy",sDate)
sVal=DatePart("h",sDate)
If Len(sVal)=2 Then sRetVal=sRetVal&sVal Else sRetVal=sRetVal&"0"&sVal End If
sVal=DatePart("n",sDate)
If Len(sVal)=2 Then sRetVal=sRetVal&sVal Else sRetVal=sRetVal&"0"&sVal End If
sVal=DatePart("s",sDate)
If Len(sVal)=2 Then sRetVal=sRetVal&sVal Else sRetVal=sRetVal&"0"&sVal End If
GetMmDdYyyyHhMmSs=sRetVal
End Function
Dim sOldFileName,sNewFileName,sTimeStamp,oFSO
sTimeStamp=GetMmDdYyyyHhMmSs(Now)
Session("attchfilename")=""
REUF_renameMask = DoTrim(Session("FirmId"),2
should be
REUF_renameMask = DoTrim(Session("FirmId"),2