增加png bmp gif jpeg多种图片格式

This commit is contained in:
Argo-Lenovo 2016-12-10 12:19:19 +08:00
parent 540ca2f18f
commit 9e20c02525
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ namespace Bootstrap.Admin.Controllers
if (files.Count > 0 && !LgbPrincipal.IsAdmin(userName))
{
var webSiteUrl = DictHelper.RetrieveIconFolderPath().Code;
var fileName = string.Format("{0}.jpg", userName);
var fileName = string.Format("{0}{1}", userName, Path.GetExtension(files[0].FileName));
var fileUrl = string.Format("{0}{1}", webSiteUrl, fileName);
var filePath = HttpContext.Current.Server.MapPath(fileUrl);
var fileFolder = Path.GetDirectoryName(filePath);

View File

@ -4,7 +4,7 @@
$('#fileIcon').fileinput({
uploadUrl: Infos.url,
language: 'zh',
allowedFileExtensions: ['jpg'],
allowedFileExtensions: ['jpg', 'png', 'bmp', 'gif', 'jpeg'],
initialPreview: [
preIcon
],