Re: do not use temp folder at all

  •  11-17-2009, 9:02 PM

    Re: do not use temp folder at all

    Hi,
     
    You can specify the uploader provider to upload the temp file to database.
     
    Here is the configuration and source code. You can modify it or create your own provider :
     
    Web.config :
     
    <add key="CuteWebUI.AjaxUploader.UseAspNetStream" value="True"/>
    <add key="CuteWebUI.AjaxUploader.Provider" value="UploaderDatabaseProvider.UploaderSqlServerProvider,App_Code"/>
    <add key="UploaderDatabase" value="server=(local);database=UploaderSamples;uid=test;pwd=test"/>
     
    Sql Schema:

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AjaxUploaderTempFiles]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[AjaxUploaderTempFiles]
    GO

    CREATE TABLE [dbo].[AjaxUploaderTempFiles] (
     [FileGuid] [uniqueidentifier] NOT NULL ,
     [FileTime] [datetime] NOT NULL ,
     [FileName] [nvarchar] (255)
     [FileSize] [int] NOT NULL ,
     [FileData] [image] NOT NULL ,
     [IsPersist] [bit] NOT NULL
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO

    ALTER TABLE [dbo].[AjaxUploaderTempFiles] WITH NOCHECK ADD
     CONSTRAINT [PK_AjaxUploaderTempFiles] PRIMARY KEY  CLUSTERED
     (
      [FileGuid]
     )  ON [PRIMARY]
    GO
     
     
    Provider Code:
     
     
     
     
    Regards,
    Terry
     
View Complete Thread