1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using System;
- using System.IO;
- namespace Admin.Core.Common.Configs
- {
-
-
-
- public class UploadConfig
- {
-
-
-
- public FileUploadConfig Avatar { get; set; }
-
-
-
- public FileUploadConfig Document { get; set; }
- }
-
-
-
- public class FileUploadConfig
- {
- private string _uploadPath;
-
-
-
- public string UploadPath
- {
- get
- {
- if (_uploadPath.IsNull())
- {
- _uploadPath = Path.Combine(AppContext.BaseDirectory, "upload").ToPath();
- }
- if (!Path.IsPathRooted(_uploadPath))
- {
- _uploadPath = Path.Combine(AppContext.BaseDirectory, _uploadPath).ToPath();
- }
- return _uploadPath;
- }
- set => _uploadPath = value;
- }
-
-
-
- public string RequestPath { get; set; }
-
-
-
- public string Format { get; set; }
-
-
-
- public string DateTimeFormat { get; set; }
-
-
-
- public long MaxSize { get; set; }
-
-
-
- public int Limit { get; set; } = -1;
-
-
-
- public string[] ContentType { get; set; }
- }
- }
|