ERROR: The form field "theFile" did not contain a file.

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default ERROR: The form field "theFile" did not contain a file.

    I'm getting this error when a user uploads a file. (I do have
    ENCTYPE="multipart/form-data" in the form definition.) If the user tries to
    upload a file that already exists, I would like him to be able to choose
    whether or not the file gets overwritten. The first page displayed to the user
    has the input field:
    <INPUT TYPE="FILE" NAME="theFile">
    When the user hits submit, CF discovers that the file already exists. What I
    would like to do is display the second page to the user with the file
    attempting to upload asking if he wishes to overwrite the alredy existing file.
    What I'm running into, is that I can't seem to upload a file with using
    TYPE="FILE" input field. On this second page I CANNOT use a TYPE="HIDDEN"
    VALUE="#theFile#" field, or assign the already chosen file in TYPE="FILE"
    VALUE="#theFile#" b/c you cannot use the VALUE attribute.

    Any ideas or suggestions??
    Thanks!!


    TanzMatias Guest

  2. Similar Questions and Discussions

    1. "select into outfile" command with field names as the first lineof the file
      Hi all ;) The question is in the subject. I had a look in the export_option but nothing appeared. I don't want to use a sophisticated tool to do...
    2. Acrobat Form Submit error: changes VALUE="true" to "0"
      I wrote an HTML page with a form. In the form I had many inputs as in: <INPUT TYPE="radio" NAME="Q1" VALUE="true"> and <INPUT TYPE="radio"...
    3. Compare 2 fields & delete everything in "field 2" that occurs in "field 1"
      Is it possible to compare 2 fields and delete everything in "field 2" that also occurs in "field 1" ? FIELD1 800-555-1212 for...
    4. Request.Form("Field Name") Versus Request.QueryString("Field Name")
      I want to know what's the differences between Request.Form("Field Name") and Request.QueryString("Field Name") OR they function exactly the...
    5. dr("field").toString returns "400.0000" instead of "400"
      I have just installed VS.NET 2003 on my computer. I have a project that I have been developing on VS.NET 2002. I haven't upgraded this project to...
  3. #2

    Default Re: ERROR: The form field "theFile" did not contain afile.

    you'll have to ask them in the first form what they want to happen before
    submitting - CF doesn't know the file exists before it goes back server side,
    nor can it arbitrarily make decisions after the fact - you have to tell it how
    to handle the file before submitting to the server.

    it may take a little thought, but you could submit the file using MAKEUNIQUE
    on the nameconflict, pull the status result to see if it renamed it or not (and
    what name it used if it did), give them the option to supply a different name,
    overwrite, or cancel the upload, then rename the temp file if they choose a new
    name (after verifying that the file name still does not exist - you may end up
    with a loop here), delete the current file and rename the new file to act as an
    overwrite, or delete the uploaded file if they cancel it.

    JMO

    SafariTECH Guest

  4. #3

    Default Re: ERROR: The form field "theFile" did not contain afile.

    You can set the nameConflict="Error" in the cffile for the upload then wrap
    that in a cftry block and create a temp file in the cfcatch.

    Then cfinclude a page that asks the relevant questions. If they want to
    overwrite it then do it. If not delete it.

    However, bear in mind that you might end up with 'ownerless files' that you
    might want to clear out using cfschedule.

    Your call.

    Stressed_Simon 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