コード例 #1
0
 public TransportableUploadedFile(HttpContext context, DynamicPicturesUploaderHandler parent, string fileName, long fileSize, string errorMessage)
 {
     this.error = errorMessage;
     this.SetProperties(context, parent, fileName, fileSize);
 }
コード例 #2
0
 public TransportableUploadedFile(HttpContext context, DynamicPicturesUploaderHandler parent, FileInfo fileInfo, string errorMessage)
     : base(context, parent, fileInfo)
 {
     this.error = errorMessage;
 }
コード例 #3
0
 protected void SetProperties(HttpContext context, DynamicPicturesUploaderHandler parent, FileInfo fileInfo)
 {
     this.SetProperties(context, parent, fileInfo.Name, fileInfo.Length);
 }
コード例 #4
0
            protected void SetProperties(HttpContext context, DynamicPicturesUploaderHandler parent, string fileName, long fileSize)
            {
                this.name = fileName;
                this.size = fileSize;
                this.url = parent.CombineUploadsUrlAndFileName(context, fileName);
                this.delete_type = parent.DeleteType.ToString().ToUpper();

                if (parent.DeleteType != DeleteMethodType.Delete)
                {
                    this.delete_url = parent.BuildUrl(parent.HttpHandlerApiUrl, "file=" + context.Server.UrlEncode(fileName) + "&_method=DELETE");
                }
                else
                {
                    this.delete_url = parent.BuildUrl(parent.HttpHandlerApiUrl, "file=" + context.Server.UrlEncode(fileName));
                }

                if (parent.AccessControlAllowCredentials)
                {
                    this.delete_with_credentials = true;
                }

                if ((parent.ClientReturnedMaximumHeight > -1
                    || parent.ClientReturnedMaximumWidth > -1)
                    && string.IsNullOrEmpty(this.error))
                {
                    dynamic newSize = parent.ScaleImage(context, parent.CombineUploadsPathAndFileName(context, fileName), parent.ClientReturnedMaximumWidth, parent.ClientReturnedMaximumHeight);
                    this.width = newSize.Width;
                    this.height = newSize.Height;
                }
            }
コード例 #5
0
 public TransportableListedFile(HttpContext context, DynamicPicturesUploaderHandler parent, FileInfo fileInfo)
 {
     this.SetProperties(context, parent, fileInfo);
 }