This is a migrated thread and some comments may be shown as answers.

need to store the data in Binary format for the Uoploaded file

1 Answer 26 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Gopi
Top achievements
Rank 2
Gopi asked on 09 Jan 2015, 12:40 PM
protected void Button1_Click(object sender, EventArgs e)
{
    int PartyRowId = 0;
    foreach (UploadedFile file in AsyncUpload1.UploadedFiles)
    {
        byte[] bytes = new byte[file.ContentLength];
        file.InputStream.Read(bytes, 0, Convert.ToInt32(file.ContentLength));
        string json3 = "{'PartyRowId':" + PartyRowId + ",'CommonCategoryRowId':" + PartyRowId + ",'CommnonCategoryAttributesRowId':" + PartyRowId + ",'PartyDoc':" + bytes + "}";
          
 
    }
}


Here i am getting json as

{'PartyRowId':0,'CommonCategoryRowId':0,'CommnonCategoryAttributesRowId':0,'PartyDoc':System.Byte[]}

Not retreving the byte info.....

could u pls help me

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 14 Jan 2015, 11:25 AM
Hello,

Actually in this case the "bytes" variable will contain the binary data of the uploaded file. For example you can store it in the data base.

Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Documentation and Tutorials
Asked by
Gopi
Top achievements
Rank 2
Answers by
Boyan Dimitrov
Telerik team
Share this question
or