Save to database in ASP.NET MVC

  •  02-02-2012, 2:03 AM

    Save to database in ASP.NET MVC

    Hello
     
    I'm trying to upload a file to a database using the entity framework.
     
    How do I modify this:
     
    void Uploader_FileUploaded(object sender, UploaderEventArgs args)
        {
            byte[] data = new byte[args.FileSize];
            using (Stream stream = args.OpenStream())
            {
                
    stream.Read(data, 0, data.Length);
            
    }
        
    }
     
     
    Parameters and so on... And how do I get the filename, size and so on? And is it possible to post directy to the action in the controller?
      
     
    Thanks
    /Lasse 
View Complete Thread