I think I've gotten to the root of the not upload issue as well. This appears to be another DataCache.GetCache root cause. In ForumUploadCollection.vb, Function GetList, the code Checks if DataCache.GetCache is null, if it is it figures out what it really should be, then SetsCache, finally it returns a DataCache.GetCache. The problem with the method is that if the cache either expires before the 1st GetCache and the 2nd GetCache or the SetCache is not set before the last GetCache, this function returns null. The suggest fix is:
Public Shared Function GetList(ByVal FolderURL As String, ByVal ModuleID As Integer) As UploadCollection
Dim strKey As String = UploadCacheKeyPrefix & ModuleID.ToString & "-" & FolderURL
Dim fileList As UploadCollection = CType(DataCache.GetCache(strKey), UploadCollection)
If fileList Is Nothing Then
fileList = New UploadCollection(FolderURL, ModuleID)
DataCache.SetCache(strKey, fileList)
End If
Return fileList
End Function
Forum_Attachement.aspx.vb, function cmdUpLoad_Click, line 228 sets mUploadCollection to nothing as a result. On the next line, it tries to access mUploadCollection.Upload() which results in a null reference exception. Since its in a try/catch, it jumps down the the catch which ends up doing nothing (should probably actually throw).
After fixing that, the file is actually uploaded and saved in the gallery, but isn't attached to the post. I need to run off to the Seahawks game, so I don't have time to investigate now. I'll post more when I get further along.
Thanks,
James