Re: Upload photo to database?

  •  02-03-2009, 10:08 AM

    Re: Upload photo to database?

    No code, apart from the uploaderdatabaseprovider you supplied. I re-created the database table using your sql definition to make sure it wasn't that.
     
    Locally am running IIS7 and SQL Express 05. For testing I am just trying to upload a .doc file about 2 megabytes in size. Am not using ajax in this example. Silverlight mode seems to work, flash and iframe don't.
     
    ASPX page and web.config: (sorry can't see how to insert code)
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    </head>
    <body>
        <form id="form1" runat="server">
        <div>  
            <CuteWebUI:Uploader ID="Uploader2" runat="server" FileTypeNotSupportMsg="File type not supported"
                InsertText="Flash(doesn't work)" OnFileUploaded="FileUploaded" UploadType="Flash">
                <ValidateOption AllowedFileExtensions="doc" MaxSizeKB="1024000" />
            </CuteWebUI:Uploader>
            <CuteWebUI:Uploader ID="Uploader2" runat="server" FileTypeNotSupportMsg="File type not supported"
                InsertText="Silverlight(does work)" OnFileUploaded="FileUploaded" UploadType="Silverlight">
                <ValidateOption AllowedFileExtensions="doc" MaxSizeKB="1024000" />
            </CuteWebUI:Uploader>
            <p>        
                <asp:Literal ID="ltOutput" runat="server" />
            </p>
        </div>
        </form>
    </body>
    </html>
     
    -- web.config:
     
    <?xml version="1.0"?>
    <configuration>
      <appSettings>
        <add key="CuteWebUI.AjaxUploader.Provider"  value="UploaderDatabaseProvider.UploaderSqlServerProvider,UploaderDatabaseProvider"/>
        <add key="UploaderDatabase" value="User ID=AjaxUploader_INETUSER;Password=XXXX;Initial Catalog=XXXX;Data Source=localhost\SQLExpress"/>
      </appSettings>

      <system.webServer>
        <modules>
          <add name="CuteWebUI.UploadModule" type="CuteWebUI.UploadModule,CuteWebUI.AjaxUploader"/>
        </modules>
      </system.webServer>

        <connectionStrings/>
        <system.web>
          
          <pages>
            <controls>
              <add namespace="CuteWebUI" assembly="CuteWebUI.AjaxUploader" tagPrefix="CuteWebUI"/>
           </controls>
          </pages>

          <!--
                Set compilation debug="true" to insert debugging
                symbols into the compiled page. Because this
                affects performance, set this value to true only
                during development.
            -->
            <compilation debug="true">

            </compilation>
            <!--
                The <authentication> section enables configuration
                of the security authentication mode used by
                ASP.NET to identify an incoming user.
            -->
            <authentication mode="Windows" />
            <!--
                The <customErrors> section enables configuration
                of what to do if/when an unhandled error occurs
                during the execution of a request. Specifically,
                it enables developers to configure html error pages
                to be displayed in place of a error stack trace.

            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->
        
        </system.web>

    </configuration>

     
     

     
     
View Complete Thread