|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Create file not found message.
hi,
i have only been doing this a couple of days, so any help would really be appreciated. i have made a page for work which uploads and file you select into a directory on one of our sql servers. the file is uploading fine. the problem is that i need to create a user friendly error message for when the users doesnt select a file before they submit the form. at the moment it is a cold fusion message 'The form field "form.file" did not contain a file.' here is the code, <cfif isdefined("form.submit")> <cffile action="upload" destination="**************" filefield="form.file" nameconflict="overwrite"> <form action="" method="post" enctype="multipart/form-data" name="submit" id="submit" > <table width="100%" border="0" align="left"> <tr> <td colspan="2"><span class="style9">NEW ENTRY </span></td> </tr> <tr valign="bottom"> <td width="71%" height="73"><div align="left"><span class="style9">SELECT FILE</span> <input name="file" type="file" size="100" /> </div></td> <td width="29%"> <input type="submit" name="Submit" value="Submit"/></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <cfif isdefined("form.submit")> <td height="51" colspan="2"> THE FILE HAS BEEN UPDATE SUCCESSFULLY!! </cfif> </tr> </table> </form> cheers for your help |
|
#2
|
|||
|
|||
|
Did you read the documentation ?
In any event, the problem appears to be in your fileField attribute which takes the name of a form field without any scope (it already knows it has to be in the form scope): <cffile action="upload" destination="**************" filefield="file" nameconflict="overwrite"> Last edited by kiteless : March 31st, 2006 at 08:04 AM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Create file not found message. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|