Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Need Multiple File Uploader Tag

Contributor ,
Mar 01, 2012 Mar 01, 2012

I know of cffileupload, but it looks like it can not work with other form elements in same form, since its flash based.

Is there any other way to incorporate a multi file uploader tag in a form. cffile only allows for one file upload.

Thanks

646
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 03, 2012 Mar 03, 2012
LATEST

You could just extend the basic upload for one file to two or more files. Here is an example:

<cfif isDefined("Form.FileContents") >

    <cffile action = "upload"

        fileField = "FileContents"

        destination = "c:\uploads"

        accept="image/jpeg,image/jpg,image/pjpeg,image/png"

        nameConflict = "overwrite">

    <cffile action = "upload"

        fileField = "FileContents2"

        destination = "c:\uploads"

        accept="application/pdf"

        nameConflict = "overwrite">

        Done uploading files.

<cfelse>

    <cfoutput><form method="post" action="#cgi.script_name#" enctype="multipart/form-data"></cfoutput>

        <input name="FileContents" type="file">

        <br>

    <input name="FileContents2" type="file">

        <br>

        <input name="submit" type="submit" value="Upload File">

    </form>

</cfif>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources