upload multiple files

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default upload multiple files

    Hi,
    I have the form where user can upload max to three files at the same time.
    Also the file is need to be overrtie if user try to post the same file again.
    My code is only upload one file. Please review the code and tell me what did I
    do wrong here
    Thanks----------
    ===========



    <cfif ISdefined("submit")>
    <cfif submit eq "Save">
    <cffile destination="#filedirectory#" action="upload"
    nameconflict="overwrite" filefield="MSG_FILE">
    </cfif>
    </cfif>

    <div align="center">Upload New File</div>
    <cfform action="" method="POST" enctype="multipart/form-data">
    <table align="center"><tr><td align="center">
    <table width="600" border="1" cellspacing="0" cellpadding="5"
    bordercolor="Navy" nowrap="YES" title="Create Posting">
    <tr>
    <th class="thr" title="Upload Job File">
    Upload Job File
    </th>
    <td class="name2">
    <input type="File" name="MSG_FILE" size="30" maxlength="30"><br>
    <input type="File" name="MSG_FILE" size="30" maxlength="30"><br>
    <input type="File" name="MSG_FILE" size="30" maxlength="30">
    </td>
    </tr>

    <tr>
    <td colspan="2" align="center" class="name2">
    <div align="center">
    <input type="Submit" name="submit" value="Save"
    title="Submit">&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="button" onclick="history.go(-1)" value=" Cancel " title="Cancel">
    </div>
    </td>
    </tr>
    </table>
    </cfform>

    newcf Guest

  2. Similar Questions and Discussions

    1. upload multiple files is this possible?
      Hi guys! is this possible to upload a whole directory or at least all files in a directory at once ? I know how to do it with 10 files then you...
    2. Upload of multiple files with Chilisoft
      The webhotel I use has installed Chilisoft. I wish to make a webpage where it is possible to upload files. So far I have only been able to upload...
    3. [PHP] Multiple upload files with php problem!!
      This is supported in the standards I think, as it says clearly in the HTML 4.01 specification on www.w3.org: "file select - This control type...
    4. Multiple upload files with php
      Hi, I need to upload multiples files using php, but with the same "<input>" tag, somebody can help my, is this feature supported by php?. Anyboy...
    5. multiple files upload
      Hi Group, In my program, the user has to be able to add one or more documents (as files) for one product from the database. The number of files...
  3. #2

    Default Re: upload multiple files

    Try a different name for each input...
    <input type="File" name="MSG_File_1"...
    <input type="File" name="MSG_File_2"...
    <input type="File" name="MSG_File_3"...
    mattw Guest

  4. #3

    Default Re: upload multiple files

    I already did but it didn't work either
    newcf Guest

  5. #4

    Default Re: upload multiple files

    Yes id did but it didn't work. Here is the code

    <cfoutput><cfif ISdefined("Submit")>
    <cfif Submit eq "upload">
    <cffile destination="#filedirectory#" action="upload"
    nameconflict="overwrite" filefield="#variables.filename#">
    </cfif>
    </cfif> </cfoutput>
    <cfset numberoffields = 3>
    <form action="" enctype="multipart/form-data" method="post">
    <cfloop index="i" from="1" to="#variables.numberoffields#" step="1">
    <cfset filename = "file" & #i#>
    <input type="File" name="<cfoutput>#variables.filename#</cfoutput>" /><br
    />
    </cfloop>
    <input type="Submit" name="upload" value="upload" />
    </form>

    newcf Guest

  6. #5

    Default Re: upload multiple files

    What is the error message? Remember, if variables.filename is undefined,
    <cfif evaluate(variables.filename) neq ""> will cause an error. Check to see if it is defined first.

    jdeline Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139