' the location of attachment files
Dim attLocation As String = "../uploads/" &"comp_"&Maincomp_id&"/"
' or
' Next Reports needs a place to write generated PDF report files
Maincomp_id = session.GetAttribute2("comp_id", 0) ' set the local "company" variable based on session variable
pdfFolder = File.DirApp &"/www/"& ABMShared.AppName&"/rptout_"&Maincomp_id
File.MakeDir(pdfFolder, "rptout_"&Maincomp_id)
' cleanup old PDF files - no longer needed...
Dim mylist As List
mylist.Initialize
mylist = File.ListFiles(pdfFolder)
If mylist.Size > 0 Then
For i = 0 To mylist.Size-1
If File.LastModified(pdfFolder,mylist.Get(i) ) < DateTime.Now - (DateTime.TicksPerDay * 10) Then
File.Delete(pdfFolder,mylist.Get(i))
Log("deleting: "&mylist.Get(i))
Else
' Log("NOT deleting: "&mylist.Get(i))
End If
Next
End If
' upload handler....
Sub Handle(req As ServletRequest, resp As ServletResponse)
'get the callback page from the session (multiple modules can use this handler)
Dim callback As Object = req.GetSession.GetAttribute("abmcallback")
' Dim downloadfolder As String = File.Combine(File.DirApp, req.GetSession.GetAttribute("abmdownloadfolder"))
Maincomp_id = req.GetSession.GetAttribute2( "comp_id", 0)
Dim downloadfolder As String = File.Combine(File.DirApp, "/www/" & ABMShared.AppName & "/uploads/"&"comp_"&Maincomp_id)
If Maincomp_id = 0 Then
Log ("--- ERROR --- MAINCOMPID IS 0 IN UPLOAD HANDLER: "&Maincomp_id)
Else
Log ("--- GOOD!!! --- MAINCOMPID IS CORRECT UPLOAD HANDLER: "&Maincomp_id)
End If