12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using Microsoft.AspNetCore.Http;
- using Microsoft.WindowsAzure.Storage.Table;
- using System;
- namespace HaBookCms.AzureStorage.AzureBlob.Models
- {
- public class AzureBlobModel :TableEntity
- {
- public AzureBlobModel() {
- }
- public AzureBlobModel(IFormFile f ,string Container) {
- ContentType = f.ContentType;
- ContentDisposition = f.ContentDisposition;
- FileName = f.FileName;
- Headers = f.Headers;
- Length = f.Length;
- Name = f.Name;
- UploadTime = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
- PartitionKey = Container;
- RowKey = Guid.NewGuid().ToString();
- Extension = f.FileName.Substring(f.FileName.LastIndexOf(".") + 1, (f.FileName.Length - f.FileName.LastIndexOf(".") - 1)); //扩展名
- }
- //
- // 摘要:
- // Gets the raw Content-Type header of the uploaded file.
- public string ContentType { get; set; }
- //
- // 摘要:
- // Gets the raw Content-Disposition header of the uploaded file.
- public string ContentDisposition { get; set; }
- //
- // 摘要:
- // Gets the header dictionary of the uploaded file.
- public IHeaderDictionary Headers { get; set; }
- //
- // 摘要:
- // Gets the file length in bytes.
- public long Length { get; set; }
- //
- // 摘要:
- // Gets the form field name from the Content-Disposition header.
- public string Name { get; set; }
- //
- // 摘要:
- // Gets the file name from the Content-Disposition header.
- public string FileName { get; set; }
- //上传时间戳
- public long UploadTime { get; set; }
- //上传时间戳
- public string Extension { get; set; }
- }
- }
|