private static Photo InternalSaveMultipart(string uploadingPath, Multipart multipart, string name) { var photo = new Photo { FileName = PhotosService.InitializeSavePath(uploadingPath, name) }; var path = Path.Combine(uploadingPath, photo.FileName); multipart.SaveToFile(path); photo.TakenAt = ImageResizer.GetExifTakenAt(path); photo.EntryAt = DateTime.Now; photo.ContentType = multipart.Body.ContentType; photo.Length = multipart.Length; return photo; }
private string InternalSaveMultipart(Multipart multipart, string name) { var baseDir = TestContext.TestDir; var path = Path.Combine(baseDir, name); if (File.Exists(path)) File.Delete(path); multipart.SaveToFile(path); return path; }