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...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationProblem with User Account module in DNN 4.8.1 versionProblem with User Account module in DNN 4.8.1 version
Previous
 
Next
New Post
5/13/2008 1:21 AM
 

I used file upload control for uploading photo but its throwing error "object reference not set to an instance of an object" only in dnn 481,dnn 482 versions. I used same control in dnn 470 version there it works fine.

Please find the code below

I used btn as  asp button control,fu as asp file upload control,img as asp image control

I am getting error in  this line  " contLength = fu.PostedFile.ContentLength" as object refererence not set to an instance of an object.
I am able to get file upload control's ID but I am not able to  capturethe content of that upload control.

Pls give me a soln.

Protected Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn.Click
            Dim contLength As Integer
            contLength = fu.PostedFile.ContentLength
            Dim myData(contLength) As Byte
            fu.PostedFile.InputStream.Read(myData, 0, contLength)
            Dim strpath As String = "C:\Inetpub\wwwroot\iredver1.0\CompanyLogo"
            Dim strfileName As String = Path.GetFileName(fu.PostedFile.FileName)
            Dim strpth As String = ""
            strpth = Path.Combine(strpath, strfileName)
            fu.SaveAs(strpth)
            img.ImageUrl = strpth

  End Sub

 

 

Report
 
New Post
7/25/2008 12:37 PM
 

Have you been able to fix this as I'm having the exact similar error on a module I use to upload a photo from a client..

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationProblem with User Account module in DNN 4.8.1 versionProblem with User Account module in DNN 4.8.1 version


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