Advertisement

06.30.2008 at 01:07AM PDT, ID: 23526168
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

Upload files and error check in coldfusion

Asked by panosms in Cold Fusion Markup Language, ColdFusion Application Server, ColdFusion Studio

Tags: ,

Hello experts.
I have a page where i'm uploading files and check if they are  images and the filesize.
After the upload i reload the page and get there the uploaded images.The problem i have is that when i'm using the <cflocation> tag after the query the upload function works fine but the error handling does not work.
How can i fix this problem
Any help?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
<cfquery name="artikel" datasource="#dsn#">
SELECT a.Art_ID, a.Photo1, a.Photo2
From artikel a
WHERE Art_ID = 244
</cfquery>
<cfset errors = "">
<cfif CGI.REQUEST_METHOD IS "POST">
<!--- Upload helper --->
<cfparam name="SERVERFILE1" default="images_1.jpg">
<cfparam name="SERVERFILE2" default="images_1.jpg">
<cfset newWidth = 300>
<cfset newHeight = 225>
<CFSET thispath = expandpath("./images")>
  <cfif structKeyExists(form,"foto1") and len(form.foto1)>
  <!--- uploads a file to our website --->
  
  <CFFILE action="upload" filefield="foto1" destination="#thispath#" nameconflict="MAKEUNIQUE" >
    <cfif Lcase(file.ClientFileExt)NEQ "gif"
              AND Lcase(file.ClientFileExt) NEQ "jpg"
          AND Lcase(file.ClientFileExt) NEQ "jpeg">
     <cffile  action="delete" file="#thispath#/#cffile.serverfile#">
     <cfset   errors = errors & "Hauptfoto  ist kein Foto!">
     
     
     <cfelseif file.Filesize GT 500 * 1024>
     <cffile  action="delete" file="#thispath#/#cffile.serverfile#">
     <cfset errors = errors & "Mainimage is too big!<br />">
     <cfelse>
     <cfimage name="uploadedImage"
   source="#thispath#/#cffile.serverFile#" >
    <cfimage action="resize"
    height="#newHeight#"
    width="#newWidth#"
    source="#uploadedImage#"
    destination="#thispath#/#cffile.serverFile#"
    overwrite="true"/> <CFSET ServerFile1 = FILE.SERVERFILE></cfif></cfif>
    
  <cfif structKeyExists(form,"foto2") and len(form.foto2)>     
  <CFFILE action="upload" filefield="foto2" destination="#thispath#" nameconflict="MAKEUNIQUE">
   
   <cfif Lcase(file.ClientFileExt) NEQ "gif"
              AND Lcase(file.ClientFileExt) NEQ "jpg"
          AND Lcase(file.ClientFileExt) NEQ "jpeg">
    <cffile  action="delete" file="#thispath#/#cffile.serverfile#">
    <cfset   errors = errors & "Foto2  ist kein Foto!">
    <cfelseif file.Filesize GT 500 * 1024>
    <cffile  action="delete" file="#thispath#/#cffile.serverfile#">
    <cfset errors = errors & "Foto2  ist zu gross!<br />">
    <cfelse>
    <cfimage name="uploadedImage"
   source="#thispath#/#cffile.serverFile#" >
    <cfimage action="resize"
       height="#newHeight#"
       width="#newWidth#"
       source="#uploadedImage#"
       destination="#thispath#/#cffile.serverFile#"
       overwrite="true"/>
       <CFSET ServerFile2 = FILE.SERVERFILE>
       </cfif></cfif>
       
 
   
       <cfquery name="imageupload" datasource="#dsn#">
Update dbo.artikel
SET photo1 =<Cfif len(ServerFile1)>'#ServerFile1#'<cfelse>photo1</cfif>,
    photo2 =<Cfif len(ServerFile2)>'#ServerFile2#'<cfelse>photo2</cfif>
     Where Art_Id= 244
</cfquery>
<cflocation url="InsertPhoto.cfm">
</cfif>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
 
<body>
 
    <cfif errors neq "">
      <div><table cellspacing="0" cellpadding="0" class="Tablewarnings">
  <tr>
    <td><img src="img/warning.png" /></td>
    <td><cfoutput>
    <p>
    <b>Check out the errors:<br />
    #errors#
    </b>
    </p>
    </cfoutput></td>
  </tr>
</table></div></cfif>
<form action="#CGI.SCRIPT_NAME#" method="post" enctype="multipart/form-data" name="UpdateForm" id="UpdateForm">
      <table cellspacing="0" cellpadding="0">
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><table width="664" >
                    <tr>
                      <td height="18" colspan="6" >&nbsp;</td>
                      </tr>
                    
              <tr>
                  <td width="78" rowspan="2" class="textfoto">Hauptfoto:</td>
                  <td width="241" ><input name="imageField" type="image"  id="imageField" src="images/<cfoutput>#artikel.Photo1#</cfoutput>" width="80" height="60" /></td>
                  <td width="67">Foto 2:</td>
                  <td colspan="2"><input name="imageField3"  type="image" id="imageField3" src="images/<cfoutput>#artikel.Photo2#</cfoutput>" width="80" height="60" /></div></td>
              </tr>
              <tr>
                <td id="foto1">
                         <input name="foto1" type="file" size="14" /></td>
                <td colspan="2" id="foto3">&nbsp;</td>
                <td><div align="center">
                  <input name="foto3" type="file" 
                                                  id="foto2" size="14" />
                </div></td>
              </tr>
         </table>
                  
      </td>
        </tr>
        <tr>
          <td><input type="submit"  lang="de"  height="30" width="60" name="update" id="update" value="Upload" />
        </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
      </form>
 
</body>
</html>
[+][-]06.30.2008 at 06:06AM PDT, ID: 21898744

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 12:36PM PDT, ID: 21902340

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 12:46PM PDT, ID: 21902421

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 12:55PM PDT, ID: 21902496

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 01:02PM PDT, ID: 21902554

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 01:06PM PDT, ID: 21902600

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 01:32PM PDT, ID: 21902779

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 01:52PM PDT, ID: 21902946

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 02:08PM PDT, ID: 21903057

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 06:06AM PDT, ID: 21915904

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 06:12AM PDT, ID: 21915959

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Cold Fusion Markup Language, ColdFusion Application Server, ColdFusion Studio
Tags: ADOBE, Coldfusion
Sign Up Now!
Solution Provided By: Jester_48
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.02.2008 at 06:50AM PDT, ID: 21916328

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 06:56AM PDT, ID: 21916371

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 07:09AM PDT, ID: 21916509

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 07:14AM PDT, ID: 21916578

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 07:17AM PDT, ID: 21916599

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 07:24AM PDT, ID: 21916691

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 07:29AM PDT, ID: 21916758

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 07:30AM PDT, ID: 21916763

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 07:56AM PDT, ID: 21917049

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.02.2008 at 08:38AM PDT, ID: 21917503

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628