Click here to Skip to main content
15,867,488 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi everybody, I have write a program send and recieve a large file , now it can transfer a file size 1.5G but when I choose large file about 2G it fail and notify:

http://i1055.photobucket.com/albums/s505/vn_photo/Untitled-27_zpscf61b7a1.jpg[^]

Here is Project:

http://www.mediafire.com/?p9b2xj2970d7cqb

Please read and help me, it code is short, no long, I need a help I'm nearing to send it for my teacher, I hope everyone will help me.
Posted
Comments
Jibesh 17-Dec-12 3:56am    
for your kind attention CP member normally dont download files from websites unknown to them. If you want a better answer paste the code snippet where you are getting error here. we have better editor here so that you can format the look and feel of the code for better understanding to the other member of this forum.

In future, copy and paste the error message instead of saving it as a bit map - it's a lot easier and doesn't waste our time so much.
And show your relevant code - don't expect me to go to your site and download an unknown project form an unknown person and load it on my system - because I won't. I have no idea what it does, and I'm not risking it getting run on my system.

So, without looking at your code, it's pretty obvious: you are using an int - which is an int32 - which is a signed varaiable that can hold values from -2147483648 to 2147483647 - so when you try to load a value larger than 2Gb - 1 into it, it overflows and you get an error. Use long instead.
 
Share this answer
 
Hi,

You'll be doing a Convert.ToInt32(something) on line 84 in your server project.

The information your trying to convert is too large to hold in the int so change your variable type to hold something larger.
 
Share this answer
 
I could not go through your code. But from the error message it is clear some value is exceeding the value of an integer.
Debug and then see where exactly you are getting the exception.
Change the datatype of that variable to long and your code should work.
 
Share this answer
 
Int32 is limited to values between -2^31 and 2^31-1: -2147483648 to 2147483647.
2G is 2^31 and it cannot be stored in an Int32.
You may use an UInt32 (unsigned int)( values between 0 and 4294967295 = 4G-1) or an Int64.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900