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
Deepika Chaudhary
1.6k
136
97.7k
Problem with byte array with more size
Aug 2 2011 7:51 AM
Hi all,
i want to upload file using web service..
For that i have written this code in client application.
I have a problem with more no. of bytes. like for 1 gb(1073741823)
I am not able to create the byte array with this size. i want to upload maximum 2 gb file.
byte
[] data =
new
byte
[1073741823];
Getting following error at run time.
Exception of type 'System.OutOfMemoryException' was thrown.
System.IO.
FileStream
stream =
new
System.IO.
FileStream
(fileInfo.FullName, System.IO.
FileMode
.Open, System.IO.
FileAccess
.Read)
BinaryReader
br =
new
BinaryReader
(stream);
long
numBytes = fileInfo.Length;//here fileinfo.length value is 1073741823
data = br.ReadBytes((
I am again getting the same exception error in the above line.
How to solve this problem..how can this work till 2 gb size(
2147483647 bytes)
Please help..
int
)numBytes);
Reply
Answers (
10
)
How to add table data to DataGridView columns
How returning to the same directory ago?