Last active
October 5, 2020 17:35
-
-
Save chsami/f89656df92657708e1c432c17b3055e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost] | |
public ActionResult UploadFile() | |
{ | |
var Files = Request.Form.Files; // Load File collection into HttpFileCollection variable. | |
//I ONLY TAKE THE FIRST FILE FOR EXAMPLE PURPOSES | |
var imageStream = Files[0].OpenReadStream(); | |
var directories = ImageMetadataReader.ReadMetadata(imageStream); | |
var exifSubDirectory = directories.OfType<ExifSubIfdDirectory>().FirstOrDefault(); | |
var originalDate = exifSubDirectory?.GetDescription(ExifDirectoryBase.TagDateTimeOriginal); | |
return Ok(originalDate) | |
} |
Why are you using the using(var ms = new MemoryStream())? What is the xyz var?
leftover code. fixed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why are you using the using(var ms = new MemoryStream())? What is the xyz var?