Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumArgumentNullException when trying to "Add" attachment.ArgumentNullException when trying to "Add" attachment.
Previous
 
Next
New Post
1/18/2006 12:22 PM
 

Hi Crispy, I have the same problem. I try to attach a file to a post, it seems that the upload is ok and the post is sent ok. (I see the file in the File Manager), but when I read the post, there is no an icon or link for the attachment, so there is no way to see the attached file (it's not present in the UI). It seens to be a bug, because I've also checked the Forum_Attachments table and it's empty. Is there any fix for this yet? Thanks.

 

 
New Post
1/18/2006 2:37 PM
 

James, this module is not setup for 2k5 source enviroment. (Nor will it be until we stop support 3.x installs)

I cannot fix what I cannot reproduce. 


Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
New Post
1/21/2006 4:01 AM
 

Hey Crispy -  I got forum building with 2k5 (only 45 warnings) and was able to debug my issue:

ForumAttachFile.vb - Line 194
strMessage +=
String.Format(Localization.GetString("ExceedFileSize.Text", ForumConfig.SharedResourceFile), ForumConfig.AttachmentFileSize.ToString)

Localization.GetString("ExceedFileSize.Text", ForumConfig.SharedResourceFile) = Null

When I opened up the SharedResoureFile, I didn't see "ExceedFileSize.Text" defined.  So I threw one together:
 <data name="ExceedFileSize.Text">
  <value>File Size Must Be Smaller Than {0} (KB).</value>
 </data>

But this bubbled up the fact that I've run into an attachement size limit.  Which was wierd because I had set it to 200, which I assumed meant 200k.  I then looked at the code and saw:

If (ContentLength > ForumConfig.AttachmentFileSize / 1024) AndAlso (Extension(True).ToLower.IndexOf("zip") = -1) Then

Shouldn't that be ForumConfig.AttachmentFileSize* 1024?

I'll go reset it to 0 and see if I can make any more progress.

James

 
New Post
1/22/2006 3:46 PM
 
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

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumArgumentNullException when trying to "Add" attachment.ArgumentNullException when trying to "Add" attachment.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out