How to get the inline elements for file upload.

Discussion in 'PHP' started by ungalnanban, Nov 20, 2010.

  1. ungalnanban

    ungalnanban New Member

    Joined:
    Feb 19, 2010
    Messages:
    45
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Chennai
    I have wrote the following code into my JavaScript function for generating dynamic(n no of) file upload field. the inline code write into div tag
    Code:
      for(i = 1; i <= count_1; i++) {
       code = code + "<textarea rows=2 cols=21 name=Description" + i
             + "  id=Description" + i + "></textarea>";
    
       for(j = 0; j < arr.length; j++) {
          code = code + "<input type=file  name=file" + j
                 + "  id =file" + j + " class='browser' />";
       }
    }
    
    document.getElementById('range_type').innerHTML = code;
    
    while submitting the form I get the Descriptions. but I'm unable to get the $_FILES details. I have used the form method is POST.
    I have set the folowing attributes into my form tag.
    Code:
      name = example
    method='POST' 
    style='display:inline;'
    ENCTYPE='multipart/form-data' 
    onsubmit='return validate form()' 
    
    How to get the $_FILES details for uploading the files.
     
    Last edited: Nov 20, 2010

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice