Save files in database with entity framework

前端 未结 4 759
故里飘歌
故里飘歌 2020-12-30 02:57

I have an ASP.NET MVC solution built on Entity Framework with Microsoft SQL Server 2008. I need to create a function that lets my users upload files.

What I would l

4条回答
  •  盖世英雄少女心
    2020-12-30 03:59

    Here's how I do it for Podcasts:

    
    ID     Title         Path                    Summary              UploadDate
    ---    -----        --------              ----------------        -----------
    1     TestPodcast   /Podcasts/ep1.mp3      A test podcast         2010-02-12
    
    

    The path stores a reference to the physical location of the Podcast. I used a post from Scott Hanselman on File Uploads with ASP.NET MVC to deal with the file upload part.

提交回复
热议问题