public UploadInfo CreateValue(IFieldUpload upload, DataRow row) { TkDebug.AssertArgumentNull(upload, "upload", this); TkDebug.AssertArgumentNull(row, "row", this); string fileName = row.GetString(upload.FileNameField); if (string.IsNullOrEmpty(fileName)) { return(null); } UploadInfo info = new UploadInfo { FileName = fileName, ContentType = row.GetString(upload.MimeTypeField), ServerPath = row.GetString(upload.ServerPathField), FileSize = row.GetValue <int>(upload.SizeField), WebPath = row.GetString(upload.ContentField) }; return(info); }
public override UploadInfo CreateValue(IFieldUpload upload, IFieldValueProvider provider) { TkDebug.AssertArgumentNull(upload, "upload", this); TkDebug.AssertArgumentNull(provider, "provider", this); string fileName = provider.GetValue(upload.FileNameField); if (string.IsNullOrEmpty(fileName)) { return(null); } UploadInfo info = new UploadInfo { FileName = fileName, ContentType = provider.GetValue(upload.MimeTypeField), ServerPath = provider.GetValue(upload.ServerPathField), FileSize = provider.GetValue <int>(upload.SizeField), WebPath = provider.GetValue(upload.ContentField) }; return(info); }
public WebUploadResult(UploadInfo uploadInfo) : base(string.Empty) { UploadInfo = uploadInfo; }