WEB Need help with CFM/JavaScript Upload Script...

Discussion in 'OT Technology' started by brds, Jul 8, 2008.

  1. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,642
    Likes Received:
    13
    Location:
    Atlanta
    I have a script that uses JS to allow users to select "upload another file" like gmail has. Only problem is that i dont know what each uploaded file is called once the user submits the form.

    You can see the site HERE and my code is below:

    in the <head>:
    Code:
    var upload_number = 1;
    function addFileInput()
    {
         var d = document.createElement("div");
         var file = document.createElement("input");
         file.setAttribute("type", "file");
         file.setAttribute("name", "attachment"+upload_number);
         d.appendChild(file);
         document.getElementById("moreUploads").appendChild(d);
         upload_number++;
    }
    
    in the <body>:
    Code:
    <input type="file" name="fileUpload" id="attachment" onchange="document.getElementById('moreUploadsLink').style.display = 'block';" />
    <div id="moreUploads"></div>
    <div id="moreUploadsLink" style="display:none;"><a href="javascript:addFileInput();" style="color:#0000ad;">Attach another File</a></div>
    
    I set a cfdump to display once i submit the page with multiple uploads... this was my result:
    [​IMG]

    Any ideas how to process the form if multiple items are uploaded? :x:
     

Share This Page