public TransportableUploadedFile(HttpContext context, DynamicPicturesUploaderHandler parent, string fileName, long fileSize, string errorMessage)
 {
     this.error = errorMessage;
     this.SetProperties(context, parent, fileName, fileSize);
 }
 public TransportableUploadedFile(HttpContext context, DynamicPicturesUploaderHandler parent, FileInfo fileInfo, string errorMessage)
     : base(context, parent, fileInfo)
 {
     this.error = errorMessage;
 }
 protected void SetProperties(HttpContext context, DynamicPicturesUploaderHandler parent, FileInfo fileInfo)
 {
     this.SetProperties(context, parent, fileInfo.Name, fileInfo.Length);
 }
            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;
                }
            }
 public TransportableListedFile(HttpContext context, DynamicPicturesUploaderHandler parent, FileInfo fileInfo)
 {
     this.SetProperties(context, parent, fileInfo);
 }