ckfinder 怎么给上传的文件改名 .
解决方案 »
- 关于验证控件问题??
- 如何在页面加载完成后调用js函数?
- 全局变量问题
- 这个人才网,我做了一半,传到了空间上,大家看看还有没有必要做下去》》》
- -->如何得出客户端所用的操作系统版本?...在线等
- DataKeyField 属性设置的问题(在线求助...)
- 写web控件,怎么才能使得属性能够列出所有当前页面中的textbox页面,就像微软的验证控件一样?
- .net 代码方法 实现.cab 格式的解压压缩
- 如何捕获在datagrid模版列中dropdownList控件的selectindexchange事件。
- MVC GZIP压缩页面报错?
- 求正则表达式,各位大哥帮忙
- 求treegrid demo或源码
里面去看代码,上传修改是在这里的
{
sFilePath = System.IO.Path.Combine( sServerDir, sFileName ); if ( System.IO.File.Exists( sFilePath ) )
{
iCounter++;
sFileName =
sFileNameNoExt +
"(" + iCounter + ")" +
System.IO.Path.GetExtension( oFile.FileName ); iErrorNumber = Errors.UploadedFileRenamed;
}
else
{
oFile.SaveAs( sFilePath ); if ( Config.Current.SecureImageUploads && ImageTools.IsImageExtension( sExtension ) && !ImageTools.ValidateImage( sFilePath ) )
{
System.IO.File.Delete( sFilePath );
ConnectorException.Throw( Errors.UploadedCorrupt );
} Settings.Images imagesSettings = Config.Current.Images; if ( imagesSettings.MaxHeight > 0 && imagesSettings.MaxWidth > 0 )
{
ImageTools.ResizeImage( sFilePath, sFilePath, imagesSettings.MaxWidth, imagesSettings.MaxHeight, true, imagesSettings.Quality ); if ( Config.Current.CheckSizeAfterScaling && this.CurrentFolder.ResourceTypeInfo.MaxSize > 0 )
{
long fileSize = new System.IO.FileInfo( sFilePath ).Length;
if ( fileSize > this.CurrentFolder.ResourceTypeInfo.MaxSize )
{
System.IO.File.Delete( sFilePath );
ConnectorException.Throw( Errors.UploadedTooBig );
}
}
} break;
}
}就这段代码if ( System.IO.File.Exists( sFilePath ) )
{
iCounter++;
sFileName =
sFileNameNoExt +
"(" + iCounter + ")" +
System.IO.Path.GetExtension( oFile.FileName ); iErrorNumber = Errors.UploadedFileRenamed;
}
sExtension = sExtension.TrimStart( '.' );
sFileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "." + sExtension;