public ActionResult SimpleUploadPartial(string controlId, string moduleKey, string sourceType, int?maxFilesize, string acceptedFiles, int?mediumThumbnailWidth = null, int?mediumThumbnailHeight = null, int?smallThumbnailWidth = null, int?smallThumbnailHeight = null, FileType?fileType = null, ThumbnailType thumbnailType = ThumbnailType.WhiteEdge, bool?waterMark = false, UploadPartialType uploadType = UploadPartialType.Both) { Argument.ThrowIfNullOrEmpty(controlId, "controlId"); if (maxFilesize == null || maxFilesize == 0) { maxFilesize = 4; } if (string.IsNullOrWhiteSpace(acceptedFiles)) { acceptedFiles = ".bmp,.jpg,.jpeg,.gif,.png"; } ViewBag.ControlId = controlId; ViewBag.IsPublic = true; ViewBag.MaxFiles = 1; ViewBag.MaxFilesize = maxFilesize; ViewBag.AcceptedFiles = acceptedFiles; ViewBag.AutoProcessQueue = true; ViewBag.FileType = fileType; ViewBag.WaterMark = waterMark; ViewBag.UploadType = uploadType; ViewBag.MediumThumbnailWidth = mediumThumbnailWidth; ViewBag.MediumThumbnailHeight = mediumThumbnailHeight; ViewBag.SmallThumbnailWidth = smallThumbnailWidth; ViewBag.SmallThumbnailHeight = smallThumbnailHeight; ViewBag.ThumbnailType = thumbnailType; return(PartialView("_PartialSimpleUpload")); }
public ActionResult UploadPartial(string controlId, Guid?sourceId, string moduleKey, string sourceType, bool?isPublic, int?maxFiles, int?maxFilesize, string acceptedFiles, string defaultValue = "", int?mediumThumbnailWidth = null, int?mediumThumbnailHeight = null, int?smallThumbnailWidth = null, int?smallThumbnailHeight = null, bool?autoProcessQueue = true, bool?editMode = true, FileType?fileType = null, ThumbnailType thumbnailType = ThumbnailType.WhiteEdge, bool?waterMark = false, UploadPartialType uploadType = UploadPartialType.Both) { Argument.ThrowIfNullOrEmpty(controlId, "controlId"); if (maxFiles == null || maxFiles == 0) { maxFiles = 1; } if (maxFilesize == null || maxFilesize == 0) { maxFilesize = 4; } if (isPublic == null) { isPublic = true; } if (string.IsNullOrWhiteSpace(acceptedFiles)) { acceptedFiles = ".bmp,.jpg,.jpeg,.gif,.png"; } if (autoProcessQueue == null) { autoProcessQueue = true; } ViewBag.ControlId = controlId; ViewBag.IsPublic = isPublic; ViewBag.MaxFiles = maxFiles; ViewBag.MaxFilesize = maxFilesize; ViewBag.AcceptedFiles = acceptedFiles; ViewBag.AutoProcessQueue = autoProcessQueue; ViewBag.DefaultValue = defaultValue; ViewBag.EditMode = editMode; ViewBag.FileType = fileType; ViewBag.WaterMark = waterMark; ViewBag.UploadType = uploadType; ViewBag.MediumThumbnailWidth = mediumThumbnailWidth; ViewBag.MediumThumbnailHeight = mediumThumbnailHeight; ViewBag.SmallThumbnailWidth = smallThumbnailWidth; ViewBag.SmallThumbnailHeight = smallThumbnailHeight; ViewBag.ThumbnailType = thumbnailType; if (sourceId != null) { var currentFiles = _storageFileService.GetFiles(sourceId.Value, moduleKey, sourceType); ViewBag.DefaultValue = string.Join(",", currentFiles.Distinct().Select(f => f.Id)); ViewBag.CurrentFiles = currentFiles; } return(PartialView("_PartialUpload")); }