I Have already tried it in that way, but it stops running the code.

in the debugging info it shows the error
Exceptions

12:49:52.052 - Object Exception - in C:\CFusionMX\wwwroot\dev\dundas\dundas.cfm : line 3
    An exception occurred when executing a Com method.

is this component documentation it says that some server will through exceptions, so use On Error Resume Next.

below is my codes

<cftry>
<cfobject type="com" class="Dundas.Upload.2" action="" name="objUpload">
<CFset objUpload.Save("c:\temp")>
<!--- If Err.Number <> 0 Then
Response.Redirect "Error.asp"
Else
<cfif InStr(1,objUploadedFile.ContentType,"octet-stream")>
<cfset objUploadedFile.Delete()>
</cfif>
--->
<cfoutput><br>The name of the form item is: #objFormItem#
  <br>The value of the form item is: #objFormItem.Value#<br>"
</cfoutput>
<cfSet objUpload = "Nothing">
<cfcatch>
<cfreturn false>
</cfcatch>
</cftry>

Thanks
Asim
>> In ASP we use
>
>There is no exact equivalent to "On Error Resume Next" in CFML. I would
>argue that this is a good thing - I think that "On Error Resume Next" is
>terrible!
>
>Instead, we have exception handling. For any block of code that you expect
>might fail, you can use CFTRY/CFCATCH to build an exception handler. In
>addition to being able to continue running code, you can actually respond to
>the specific problem encountered.
>
>In your case, if you simply want to continue running code, you could do
>this:
>
><cftry>
>
> ... problematic code goes here ...
>
> <cfcatch type="any">
> <!--- do nothing --->
> </cfcatch>
>
></cftry>
>
>Dave Watts, CTO, Fig Leaf Software
>http://www.figleaf.com/
>phone: 202-797-5496
>fax: 202-797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to