Created
October 30, 2014 20:56
-
-
Save JustinK/352b0e356fa767285871 to your computer and use it in GitHub Desktop.
This file contains 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
var imageFile = hiddenFile.Value; | |
String img = imageFile.Replace("data:image/jpeg;base64,", "").Replace(" ", "+"); | |
byte[] b = Convert.FromBase64String(img); | |
var timestamp = DateTime.Now.ToString("yyyy_MM_dd_HHmmssfff"); | |
var virtualDirectoryPath = "~/Receipts/" + year + "/"; | |
var fileName = Path.Combine(page.Server.MapPath(virtualDirectoryPath), | |
timestamp + ".jpg"); | |
System.IO.File.WriteAllBytes(fileName, bytes); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment