Re: How to validate a file being uploaded across a SQL db?

  •  12-19-2012, 11:50 AM

    Re: How to validate a file being uploaded across a SQL db?

    Ken,

     

    Thanks for getting back to me. I am trying something similar but its not working. I am trying to query into a Recordset and possibly find the file selected by the user within the recordset and if it doesn't exist then alert the user of it.

     

     

     

    1. <script>  
    2. function CuteWebUI_AjaxUploader_OnSelect(files) {  
    3.   
    4.                  <%  
    5.                 Set AdoCon=Server.CreateObject("ADODB.Connection")  
    6.                 Set AdoRec=Server.CreateObject("ADODB.Recordset")  
    7.                 AdoCon.ConnectionString="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=*******;Initial Catalog=AFDDB_DEVY;Data Source=MOMENTUMTEST"  
    8.                 AdoCon.Open  
    9.                 AdoRec.Open "Select Custid from APPLICATION",AdoCon  
    10.                 str=AdoRec.GetString()  
    11.                   %>  
    12.   
    13.   
    14.                 for (var i = 0; i < files.length; i++) {   
    15.                 var name = files[i].FileName;   
    16.                 if (str=name) {   
    17.                     alert(name);  
    18.                     'files[i].Cancel();   
    19.                     }   
    20.                 }    
    21.                   
    22.                   
    23.                   <%  
    24.                 AdoRec.close  
    25.                 AdoCon.close  
    26.                 set AdoRec = Nothing  
    27.                 set AdoCon = Nothing  
    28.                     %>          
    29.                    
    30. </script>  
     I am just having it show me an alert but its not working. If I do a Response.Write(str) Then it does show me the query response from the database fine.

     

    Do you know the issue here?

     

    Thanks,

    Khan

View Complete Thread