Object reference not set to an instance of an object.

M

Mike John

I am trying to browse for a picture and save to the server
image folder
I tried the following code:

HTML:*********************
<INPUT id="UpLoadFile" style="Z-INDEX: 140; LEFT: 140px;
WIDTH: 377px; POSITION: absolute; TOP: 488px; HEIGHT:
22px" type="file" size="43" runat="server">

ASP:***************************
Private Sub UpLoadImage()







Dim hpfIS As HttpPostedFile
hpfIS = UpLoadFile.PostedFile ' uploadfile is the
id of an intput type 'file' that I have created in html

If hpfIS.ContentLength = Nothing Then
Exit Sub
End If

hpfIS.SaveAs(Server.MapPath("images") & "\" &
Me.txtRecID.Text & ".jpeg")


End Sub

any reason why I am geting the error :"Object reference
not set to an instance of an object. "


sincerely yours


Mike John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,999
Latest member
MakersCBDGummiesReview

Latest Threads

Top