Click here to Skip to main content
15,885,546 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to Upload large size file to server Pin
Vimalsoft(Pty) Ltd30-Jun-09 2:42
professionalVimalsoft(Pty) Ltd30-Jun-09 2:42 
GeneralRe: How to Upload large size file to server Pin
musefan30-Jun-09 2:43
musefan30-Jun-09 2:43 
GeneralRe: How to Upload large size file to server Pin
Vimalsoft(Pty) Ltd30-Jun-09 2:47
professionalVimalsoft(Pty) Ltd30-Jun-09 2:47 
GeneralRe: How to Upload large size file to server Pin
musefan30-Jun-09 2:58
musefan30-Jun-09 2:58 
AnswerRe: How to Upload large size file to server Pin
musefan30-Jun-09 2:33
musefan30-Jun-09 2:33 
GeneralRe: How to Upload large size file to server Pin
wasimsharp30-Jun-09 2:42
wasimsharp30-Jun-09 2:42 
AnswerRe: How to Upload large size file to server Pin
musefan30-Jun-09 3:01
musefan30-Jun-09 3:01 
AnswerRe: How to Upload large size file to server Pin
Anthony Mushrow30-Jun-09 3:08
professionalAnthony Mushrow30-Jun-09 3:08 
Two things.

i = stream.Read(buffer,0, buffer.Length)

That's fine, but later on
reqStream.Write(buffer, 0, buffer.Length);

You try to send the whole buffer, but if you only read 215 bytes in to the buffer in the first place then you would be sending garbage.

You should use the variable you set before to make sure you only send what you read in.
reqStream.Write(buffer, 0, i);

It would probably be fine since the whole file would be put in the buffer, but just to be safe.

As for your other problem, if you use BeginWrite you need to wait until the callback before closing the stream, at the moment you could be closing the stream while you're still trying to send data down it.

If you where to use the regular Write method, you would probably want to check how many bytes where actually written and make sure you send all of your data.

My current favourite word is: Delicious!
-SK Genius

Game Programming articles start -here[^]-

QuestionMySQL restore database through c# Pin
mariamkhaqan30-Jun-09 2:06
mariamkhaqan30-Jun-09 2:06 
AnswerRe: MySQL restore database through c# Pin
Pavel123123__27-Oct-09 5:32
Pavel123123__27-Oct-09 5:32 
GeneralRe: MySQL restore database through c# Pin
adiono26-Dec-09 23:52
adiono26-Dec-09 23:52 
GeneralRe: MySQL restore database through c# Pin
ogimenezb31-May-11 6:05
ogimenezb31-May-11 6:05 
QuestionSql query designer Pin
Dushan12330-Jun-09 1:28
Dushan12330-Jun-09 1:28 
AnswerRe: Sql query designer Pin
J4amieC30-Jun-09 1:32
J4amieC30-Jun-09 1:32 
GeneralRe: Sql query designer Pin
musefan30-Jun-09 2:16
musefan30-Jun-09 2:16 
GeneralRe: Sql query designer Pin
J4amieC30-Jun-09 2:17
J4amieC30-Jun-09 2:17 
GeneralRe: Sql query designer Pin
musefan30-Jun-09 2:19
musefan30-Jun-09 2:19 
GeneralRe: Sql query designer Pin
musefan30-Jun-09 2:30
musefan30-Jun-09 2:30 
AnswerRe: Sql query designer Pin
K030630-Jun-09 2:06
K030630-Jun-09 2:06 
GeneralRe: Sql query designer Pin
Dushan12330-Jun-09 2:31
Dushan12330-Jun-09 2:31 
AnswerRe: Sql query designer Pin
musefan30-Jun-09 2:18
musefan30-Jun-09 2:18 
AnswerRe: Sql query designer Pin
Pete O'Hanlon30-Jun-09 2:36
mvePete O'Hanlon30-Jun-09 2:36 
Questionshow custom control in aspx page Pin
Pankaj Saha30-Jun-09 1:27
Pankaj Saha30-Jun-09 1:27 
AnswerRe: show custom control in aspx page Pin
Vimalsoft(Pty) Ltd30-Jun-09 1:37
professionalVimalsoft(Pty) Ltd30-Jun-09 1:37 
GeneralRe: show custom control in aspx page Pin
Pankaj Saha30-Jun-09 1:53
Pankaj Saha30-Jun-09 1:53 

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.