Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there,

i wrote a code who search documents from local folders and attach in refrence table.
but now i want to attach documents manually.

this is i wrote:
C#
<script language="javascript">

    function isWin7OS(){
        if (navigator.appVersion.indexOf("Windows NT 6") > 0){
            return true;
        }
        else{
            return false;
        }
    }
    function searchSmallDocs() {
    showStatus("Searching small documents...");
    var fso, fFolder, fileList, fc, fs, ft;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    var sPath = "";
    if (isWin7OS()){
        sPath = unescape("<%=escape(Application("LocalFolder_Win7") + Application("SmallDoc"))%>") + sSubFolder;
    }
    else{
        sPath = unescape("<%=escape(Application("LocalFolder") + Application("SmallDoc"))%>") + sSubFolder;
    }

    fFolder = fso.GetFolder(sPath);
    fc = new Enumerator(fFolder.files);
  fileList = "";

  var iPosFile;

  while (!fc.atEnd())
    {
        fs = String(fso.GetFile(fc.item()));
        iPosFile = fs.lastIndexOf("\\")+1;
        fs= fs.slice(iPosFile);
        iPosFile = fs.lastIndexOf(".")+1;
        ft = fs.slice(iPosFile).toUpperCase();
        if ((ft == "TIF") || (((sDocType == '<%=Lan("PABX")%>') || (sDocType == '<%=Lan("FIB")%>')) && ft != "DB"))
        {
            if (fileList.length >0) {fileList += ":";}
            fileList += fs;
        }

        fc.moveNext();

    }



    self.parent.displaySmallDocs.location.href="display_small_documents_GUI.asp?retrieve=yes&count=yes&doctype="+sDocType+"&filelist=" + fileList;

}


display file code:

XML
function DisplayFiles() {
        showStatus("Searching handhole cards...");
        self.parent.displaySmallDocs.location.href="/KB/answers/display_small_documents_GUI.asp"?retrieve=yes&count=yes&doctype=<%=sDocType%>&filelist=<%=sFileList%>";
    }

    function encodeSmallDocuments() {
        var fileList = "";
        if ("<%=sRetrieve%>" == "no") {
            alert("<%=Lan("SRCHNSLCT")%>");
            return;
        }

    <%for (var i=0; i<rFileList.length;i++) {%>
            if (checkFile<%=i%>.checked) {
                if (fileList.length >0) {fileList += ":";}
                fileList += "<%=rFileList[i]%>";
            }
    <%}%>

        var sUrl= "select_small_document.asp";
        submit_form.action = sUrl;
        submit_form.target = self.parent.name;
        submit_form.PARAM_DOC_TYPE.value = "<%=sDocType%>";
        submit_form.PARAM_FILE_LIST.value = fileList;
        submit_form.submit();
    }
</script>


funcationality description:
there is a search button on web page.after clicking that button it is search documents and attach documents in reference table.now i wantto attach documents manually after click on search button.

Thanks in advance
Posted
Comments
Sergey Alexandrovich Kryukov 20-Jan-15 18:18pm    
What does it mean, "attach manually"?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900