Various types of files can be saved to the database.
File Table:
If exists (select * From DBO. sysobjects where id = object_id (n' [DBO]. [file] ') and objectproperty (ID, n'isusertable') = 1)
Drop table [DBO]. [file]
Go
Create Table [DBO]. [file] (
[ID] [int] identity (1, 1) not null,
[Filedata] [Image] Null,
[Filetype] [nvarchar] (50) Collate chinese_prc_ci_as null,
[Filename] [nvarchar] (50) Collate chinese_prc_ci_as null
) On [primary] textimage_on [primary]
Go
SaveFile. aspx --- page file
<Form ID = "form1" method = "Post" enctype = "multipart/form-Data" runat = "server">
<Font face = ""> <input id = "FILENAME" style = "Z-INDEX: 101; left: 48px; position: absolute; top: 40px" type = "file"
Name = "FILENAME" runat = "server">
<Asp: button id = "cmdup" style = "Z-INDEX: 102; left: 312px; position: absolute; top: 40px" runat = "server"
TEXT = "upload to Database"> </ASP: button> </font> </form>
SaveFile. CS