I got this problem when I tried to upload 2 or more file at 1 time. The uploaded files are corrupted. But if upload just 1 file, the uploaded file will be ok. The files were saved in the session so that can be validate at the next page and then save to a document library. I'm using 2009.3.1314.20 version
Here some of the code:
1st Page
aspx:
Codebehind:
Thanks in advanced.
Here some of the code:
1st Page
aspx:
<
telerik:RadUpload
ID
=
"Upload1"
runat
=
"server"
MaxFileInputsCount
=
"5"
Width
=
"600px"
InitialFileInputsCount
=
"1"
ControlObjectsVisibility
=
"RemoveButtons, AddButton"
/>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"OK"
OnClick
=
"Button1_Click"
/>
private
void
SaveFilesToSession()
{
IList list =
new
List<UploadedFileInfo>();
foreach
(UploadedFile uploadedFile
in
UploadDocument.UploadedFiles)
{
int
fileLength = uploadedFile.ContentLength;
byte
[] buffer =
new
byte
[fileLength];
uploadedFile.InputStream.Read(buffer, 0, fileLength);
UploadedFileInfo info =
new
UploadedFileInfo();
info.Name = uploadedFile.GetName().Trim();
info.FileInByte = buffer;
info.ContentLength = uploadedFile.ContentLength;
list.Add(info);
}
Session[
"UploadedFiles"
] = list;
}
protected
void
ButtonSubmit_Click(
object
sender, EventArgs e)
{
SaveFilesToSession();
Response.Redirect(
"Upload2.aspx"
);
}
Thanks in advanced.