?
Solved

Catch error during upload

Posted on 2003-03-14
7
Medium Priority
?
141 Views
Last Modified: 2013-12-24
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?
0
Comment
Question by:habieb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 17

Accepted Solution

by:
anandkp earned 180 total points
ID: 8135040
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
 
LVL 1

Expert Comment

by:sandeep_chheda
ID: 8135142
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
 

Author Comment

by:habieb
ID: 8149065
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:habieb
ID: 8149067
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
 

Author Comment

by:habieb
ID: 8149216
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
 
LVL 17

Expert Comment

by:anandkp
ID: 8149766
ok gr8 - so do i get points ???

heh :)

K'Rgds
Anand
0
 

Author Comment

by:habieb
ID: 8149780
tanx anand..
0

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question