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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0File UploadFile Upload
Previous
 
Next
New Post
9/9/2008 4:59 PM
 

I just can't seem to figure this out.  I'm doing a file upload and it works perfectly on my dev machine - but I get a "Object reference not set to an instance of an object".  I would use the URLControl class but I'm automatically resizing images on upload too.  Can anyone help?

<

input id="myFile" type="file" runat="server" class="CommandButton"/>
<input id="Button1" type="button" value="Upload" onserverclick="Upload" runat="server"class="CommandButton" />

Any help would be greatly appreciated!

Here's the Upload event:

Sub Upload(ByVal sender As System.Object, ByVal e As

System.EventArgs)

 

 

If Not (myFile.PostedFile Is Nothing)

Then

 

 

Dim intFileNameLength As Integer

 

Dim strFileNamePath As String

 

Dim strFileNameOnly As String

 

intFileNameLength = InStr(1, StrReverse(strFileNamePath),

strFileNameOnly = Mid(strFileNamePath, (Len(strFileNamePath) - intFileNameLength) + 2)

 

 

 

strFileNamePath = myFile.PostedFile.FileName"\")Dim Size As Integer = 400Dim bmp As Bitmap = CreateThumbnail(strFileNamePath, Size, Size)If bmp Is String.Empty Then

 

 

Me.ErrorResult()Return

 

End If

 

OutputFilename = Request.QueryString(

Dim OutputFilename As String = String.Empty"OutputFilename")

 

End If

Response.ContentType =

"image/jpeg"

bmp.Save(Response.OutputStream, System.Drawing.Imaging.Imageformat.Jpeg)

bmp.Save(Server.MapPath(Request.ApplicationPath) +

 

strFileNameOnly =

SaveImage(strFileNameOnly)

 

"images\" + strFileNameOnly, Imageformat.Jpeg)bmp.Dispose()"images\" & strFileNameOnlyEnd If

 
New Post
9/10/2008 4:22 AM
 

- If u put upload control inside a UpdatePanel, u may get "Object reference..." error, just do a google search with "FileUpload UpdatePanel",u'll find alot of solutions for this problem. And use the System.Drawing.Image for image resizing. 

 
New Post
9/10/2008 8:26 AM
 

I'm not using an updatePanel though.

 
New Post
10/16/2008 1:43 PM
 

I'm still having issues with this guys.  I got the error fixed and it works perfectly on my local machine.  When I upload the project to my DNN installation on my host server - I get nothing - no errors, no file upload.  I'm not even sure how to troubleshoot this.  Permissions look fine - everything that needs write access has it.

Does anyone have any ideas?  How would I even troubleshoot it?

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0File UploadFile Upload


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