在页面部分加入 office:office />
在代码部分加
void btnUploadTheFile_Click(object sender SystemEventArgs e)
{
if (uplTheFilePostedFile != null)
{
HttpPostedFile mFile= uplTheFilePostedFile;
int fileSize = mFileContentLength;
if (fileSize==)
{
txtErrMsgInnerText = No file uploaded try again;
return;
}
try
{
byte[] mFileByte = new Byte[fileSize];
mFileInputStreamRead(mFileBytefileSize);
string sFilename = ClientID + SystemIOPathGetFileName(mFileFileName);
SystemIOFileStream saveFile = new SystemIOFileStream(ServerMapPath(~/+RequestQueryString[UploadPath]+ / + sFilename) SystemIOFileModeCreate);
saveFileWrite(mFileByte mFileByteLength);
saveFileClose();
}
catch
{
txtErrMsgInnerText = File uploaded Unsuccessfull try again;
}
}
}