TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dealy
NA
213
0
Object reference not set to an instance of an object (byte[]
Aug 2 2016 1:36 AM
Hello,
I have the following code:
public
byte[] getFile(FileUpload file)
{
byte[] bytes=null;
using
(Stream fs = file.PostedFile.InputStream)
{
using
(BinaryReader br =
new
BinaryReader(fs))
{
bytes = br.ReadBytes((Int32)fs.Length);
}
}
return
bytes;
}
When I compile the procedure I get the following error message: "Object reference not set to an instance of an object."
Any idea how to fix the error?
Thank you in advance.
Reply
Answers (
8
)
Set properties via a file
Barcode Label Generation and Printing