示例#1
0
        public ActionResult UploadAudio(Guid bandId)
        {
            var file     = Request.Files[0];
            var filename = HttpContext.SaveAudio(file);

            var audio = new AudioModel
            {
                AudioID = Guid.NewGuid(),
                Title   = filename,
                BandID  = bandId,
                Url     = filename
            };

            DataRepository.AddAudio(audio);

            return(Json(new { success = true }));
        }