文件上传
if (addFile.PostedFile != null && addFile.PostedFile.FileName != "") {
string strFilePath = "";
string strFileExtension = "";
double dFileSize = 0;
bool bSuccess = false;
fHtmlInputFile uploadFile = new fHtmlInputFile();
uploadFile.HtmlInputFileControl = addFile;
uploadFile.FileFolder = string.Format("UpLoadFile\\{0}\\CleanPrevent\\Main", Session["UpLoadFile"].ToString());
uploadFile.AllowFileEmpty = false;
uploadFile.MaxSize = 1073741824;//最大1G文件大小;
uploadFile.RenameType = FileUpload.fHtmlInputFile.RenameTypeList.TimeNumber;
uploadFile.UpLoad();
if (uploadFile.Success) {
strFileExtension = uploadFile.FileExtension;
strFilePath = uploadFile.FilePath;
dFileSize = uploadFile.FileSize;
bSuccess = uploadFile.Success;
}
else {
zhyScript.Alert(this.Page, uploadFile.ErrorMsg);
}
if (bSuccess) {
}
}
图片上传
string strUpFileSmall = "";
string strUpLoadFileNameThumbnail = "";
bool bSuccess = false;
fHtmlInputFile uploadFile = new fHtmlInputFile();
uploadFile.HtmlInputFileControl = addFile;
uploadFile.FileFolder = string.Format("UpLoadFile\\{0}\\Integration\\SpeechContestPersonnel", Session["UpLoadFile"].ToString());
uploadFile.AllowFileEmpty = false;
uploadFile.AllowFileExtension = ".jpg|.jpeg|.png|.bmp|";
uploadFile.RenameType = FileUpload.fHtmlInputFile.RenameTypeList.TimeNumber;
uploadFile.UpLoad();
if (uploadFile.Success) {
bSuccess = uploadFile.Success;
uploadFile.MakeThumbnail(1000, 750, "W");
strUpFileSmall = uploadFile.NewFilePath;
uploadFile.MakeThumbnail(280, 210, "W");
strUpLoadFileNameThumbnail = uploadFile.NewFilePath;
}
else {
zhyScript.Alert(this.Page, uploadFile.ErrorMsg);
}
if (bSuccess) {
}
zhy_CommClass---->zhyProcessor 没周五自动生成文件夹