How to make a fileupload interface in ASP.NET

后端 未结 3 1510
被撕碎了的回忆
被撕碎了的回忆 2021-01-14 06:58

I am trying to make a file upload interface in ASP.NET webforms and am looking for some advice on how to proceed.

The file upload interface is part of a website I am

3条回答
  •  天命终不由人
    2021-01-14 07:39

    I would recommend storing the files in the database, rather than a temporary folder.

    Don't store them in Session Db - too much information, but include the SessionId in the Files Database record.

    So you'd have a Files database with a table along the lines of

     Id (int identity field)
     Data (varbinary(max))
     MimeType (varchar(50))
     SessionId (varchar(50))
    
     UserId ??
    

    Then you'd simply need to write a scheduled SQL task to clear images where the session had expired.

提交回复
热议问题