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?
habiebAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
anandkpConnect With a Mentor Commented:
hi,

no u cant do ne-thing while uploading - its only after the file is uploaded - that u can determine things

what error r u getting ???

is it the type of file that ur uploading / is it the permission's [access denied]

or is it with the error in the path of the file ur trying to upload

let me know

K'Rgds
Anand
0
 
sandeep_chhedaCommented:
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
0
 
habiebAuthor Commented:
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

0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
habiebAuthor Commented:
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

0
 
habiebAuthor Commented:
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..
0
 
anandkpCommented:
ok gr8 - so do i get points ???

heh :)

K'Rgds
Anand
0
 
habiebAuthor Commented:
tanx anand..
0
All Courses

From novice to tech pro — start learning today.