Link to home
Start Free TrialLog in
Avatar of habieb
habieb

asked on

Catch error during upload

Hi,
I need help!
My application provide upload image to user.
The problem is there is an error..but I need to know what kind of error caused the uploading is failed
Below the script:

<cftry>
     <cffile action="upload" nameconflict="makeunique" destination="#imagepath#" filefield="photo" accept="image/gif,image/jpg,image/jpeg,image/pjpeg">
     <font face="arial" size="-2" color="red">File Uploaded</font><Br>
<cfcatch type="any">
     <script>alert('File Cannot Be Uploaded\nNot An Image');</script>
     <cfinclude template="menu.cfm">
     <cfabort>
</cfcatch>
</cftry>
is there any solutions to trace the error during uploading using javascript?
ASKER CERTIFIED SOLUTION
Avatar of anandkp
anandkp
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sandeep_chheda
sandeep_chheda

write the script tag

<script language="Javascript">
alert("File Cannot Be Uploaded\nNot An Image");
</script>

if the error is javascript else check ur Menu.cfm file.

Regards,
Sandeep
Avatar of habieb

ASKER

I don't know the error. if u look at the script, it occured because there're javascript alert.

<script language="Javascript">
alert("File Cannot Be Uploaded\nNot An Image");
</script>

I've no idea how to determine the error. cfcatch type=any: it may be any error.
How to determine things after uploading?.. the uploading was failed!!!..there's no file uploaded..I've checked my image folder each time after run the page.

which is correct?
the destination "E:\application\content\images"
or
destination E:/application/content/images

Avatar of habieb

ASKER

I don't know the error. if u look at the script, it occured because there're javascript alert.

<script language="Javascript">
alert("File Cannot Be Uploaded\nNot An Image");
</script>

I've no idea how to determine the error. cfcatch type=any: it may be any error.
How to determine things after uploading?.. the uploading was failed!!!..there's no file uploaded..I've checked my image folder each time after run the page.

which is correct?
the destination "E:\application\content\images"
or
destination E:/application/content/images

Avatar of habieb

ASKER

Hi, thanks a lot to both of u. I've already settled the problem. As Anand's suggestion..I've found on the destination..ok..
ok gr8 - so do i get points ???

heh :)

K'Rgds
Anand
Avatar of habieb

ASKER

tanx anand..