Click here to Skip to main content
15,914,594 members
Home / Discussions / C#
   

C#

 
AnswerRe: Export Registry Pin
Saksida Bojan5-Mar-10 21:40
Saksida Bojan5-Mar-10 21:40 
Questionhow to create listview in C# Pin
BLKinnera5-Mar-10 20:57
BLKinnera5-Mar-10 20:57 
AnswerRe: how to create listview in C# Pin
Saksida Bojan5-Mar-10 21:11
Saksida Bojan5-Mar-10 21:11 
AnswerRe: how to create listview in C# Pin
Pranay Rana5-Mar-10 21:15
professionalPranay Rana5-Mar-10 21:15 
AnswerRe: how to create listview in C# Pin
#realJSOP6-Mar-10 1:02
professional#realJSOP6-Mar-10 1:02 
GeneralRe: how to create listview in C# Pin
OriginalGriff6-Mar-10 1:49
mveOriginalGriff6-Mar-10 1:49 
GeneralRe: how to create listview in C# Pin
#realJSOP6-Mar-10 4:34
professional#realJSOP6-Mar-10 4:34 
QuestionUpload Large Audio File Pin
sjs4u5-Mar-10 20:25
sjs4u5-Mar-10 20:25 
Hi,

I am uploading large audio file using webclient in windows form.
Now if file is small then it is uploading but if file is larger in size like 200 mb or more then it showing exception that System.OutOfMemoryException .

So How can I solved it.

My code is give below.


WebClient client = new WebClient();
Stream stream = client.OpenWrite(remoteFilename, "PUT");

// The buffer size is set to 2kb
const int buffLength = 2048;
byte[] buff = new byte[buffLength];
int contentLen;

// Opens a file stream (System.IO.FileStream) to read the file
// to be uploaded
FileStream fs = fileInf.OpenRead();

int doneSoFar = 0;
// Read from the file stream 2kb at a time
contentLen = fs.Read(buff, 0, buffLength);
//added for accurate progress
doneSoFar += contentLen;
setItemStatus("Uploading");
while (contentLen != 0)
{
setItemProgress(doneSoFar, fileInf.Length);

// Write Content from the file stream to the FTP Upload Stream
stream.Write(buff, 0, contentLen);
contentLen = fs.Read(buff, 0, buffLength);
doneSoFar += contentLen;
}

// Close the file stream and the Request Stream
stream.Close();
fs.Close();



Thanks
sjs
AnswerRe: Upload Large Audio File Pin
MumbleB5-Mar-10 22:21
MumbleB5-Mar-10 22:21 
GeneralRe: Upload Large Audio File [modified] Pin
sjs4u5-Mar-10 22:56
sjs4u5-Mar-10 22:56 
GeneralRe: Upload Large Audio File Pin
MumbleB5-Mar-10 23:21
MumbleB5-Mar-10 23:21 
GeneralRe: Upload Large Audio File Pin
sjs4u5-Mar-10 23:29
sjs4u5-Mar-10 23:29 
QuestionWord Applications Author Name Pin
sjs4u5-Mar-10 19:01
sjs4u5-Mar-10 19:01 
AnswerRe: Word Applications Author Name [modified] Pin
1.21 Gigawatts5-Mar-10 21:07
1.21 Gigawatts5-Mar-10 21:07 
Questionprotected and inheritance question (i think - yes I'm kind of new) [Solved] Pin
swo.priv5-Mar-10 18:21
swo.priv5-Mar-10 18:21 
AnswerRe: protected and inheritance question (i think - yes I'm kind of new) Pin
Khaniya5-Mar-10 18:40
professionalKhaniya5-Mar-10 18:40 
GeneralRe: protected and inheritance question (i think - yes I'm kind of new) [modified] Pin
swo.priv5-Mar-10 19:08
swo.priv5-Mar-10 19:08 
GeneralRe: protected and inheritance question (i think - yes I'm kind of new) Pin
1.21 Gigawatts5-Mar-10 21:34
1.21 Gigawatts5-Mar-10 21:34 
GeneralRe: protected and inheritance question (i think - yes I'm kind of new) Pin
swo.priv6-Mar-10 4:55
swo.priv6-Mar-10 4:55 
GeneralRe: protected and inheritance question (i think - yes I'm kind of new) Pin
OriginalGriff6-Mar-10 5:22
mveOriginalGriff6-Mar-10 5:22 
GeneralRe: protected and inheritance question (i think - yes I'm kind of new) Pin
swo.priv6-Mar-10 6:23
swo.priv6-Mar-10 6:23 
GeneralRe: protected and inheritance question (i think - yes I'm kind of new) Pin
OriginalGriff6-Mar-10 6:45
mveOriginalGriff6-Mar-10 6:45 
GeneralRe: protected and inheritance question (i think - yes I'm kind of new) Pin
swo.priv6-Mar-10 7:24
swo.priv6-Mar-10 7:24 
QuestionMessage Removed Pin
5-Mar-10 17:11
gouthami chintala5-Mar-10 17:11 
AnswerRe: how to count the frequencycount of a word in a text file Pin
Dr.Walt Fair, PE5-Mar-10 18:06
professionalDr.Walt Fair, PE5-Mar-10 18:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.