House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

CFFILE

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
I have a CFFILE question:
Monique Boea
05/26/04 10:07 A
Can you post the code for the submission form?
George Abraham
05/26/04 10:26 A
<cftry>
Monique Boea
05/26/04 10:29 A
sorry, it's long
Monique Boea
05/26/04 10:42 A
> From: Monique Boea
Philip Arnold
05/26/04 11:03 A
In my reference (cfmx):
Pascal Peters
05/26/04 01:53 P
> In my reference (cfmx):
Ben Doom
05/26/04 02:23 P
My CFFILE issue is resolved.
Monique Boea
05/26/04 03:21 P
> From: Monique Boea
Philip Arnold
05/26/04 03:27 P
YIKES!!
Monique Boea
05/26/04 03:34 P
yeah, you might want to to a
Tony Weeg
05/26/04 03:37 P
> From: Tony Weeg
Philip Arnold
05/26/04 03:42 P
full-stops?
Monique Boea
05/26/04 03:54 P
image.name.jpeg
Tony Weeg
05/26/04 04:08 P
> From: Monique Boea
Philip Arnold
05/26/04 04:50 P
sure did :)
Tony Weeg
05/26/04 04:07 P
So what's the alternative?
Monique Boea
05/26/04 03:39 P
I think full stops are periods.
Jerry Johnson
05/26/04 04:26 P
> From: Tony Weeg
Philip Arnold
05/26/04 04:49 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Monique Boea
05/26/2004 10:07 AM

I have a CFFILE question: I have a form which allows a user to upload three different images at the same time I have three different <cffile action="upload".... tags on the processing page. The problem is it only uploads the very first image... Any suggestions?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Monique Boea
05/26/2004 10:09 AM

It will upload one file at a time and not two or three together I have a CFFILE question: I have a form which allows a user to upload three different images at the same time I have three different <cffile action="upload".... tags on the processing page. The problem is it only uploads the very first image... Any suggestions?   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Damien McKenna
05/26/2004 10:14 AM

On May 26, 2004, at 10:06 AM, Monique Boea wrote: > It will upload one file at a time and not two or three together Try doing a cfloop or cfoutput with "cffile" as the query name.  I haven't tried it yet but it might work. -- Damien McKenna - Web Developer - dmckenna@thelimucompany.com The Limu Company - http://www.thelimucompany.com/ - 407-804-1014

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Monique Boea
05/26/2004 10:23 AM

Combing the three into one cffile with a loop? On May 26, 2004, at 10:06 AM, Monique Boea wrote: > It will upload one file at a time and not two or three together Try doing a cfloop or cfoutput with "cffile" as the query name.  I haven't tried it yet but it might work. -- Damien McKenna - Web Developer - dmckenna@thelimucompany.com The Limu Company - http://www.thelimucompany.com/ - 407-804-1014   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
George Abraham
05/26/2004 10:26 AM

Can you post the code for the submission form? George At 10:20 AM 5/26/2004, Monique Boea wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Monique Boea
05/26/2004 10:29 AM

<cftry>     <!--- upload new file --->     <cffile action="upload" filefield="form.tLogoFilename" destination="#variables.home_dir#media\images\clientlogos\#variables.tLogoFi lename#" nameconflict="overwrite">    <cfcatch>     <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">     alert("Error uploading Logo file.  Please try again.");     history.go(-1);     </SCRIPT>     <cfexit>    </cfcatch>    </cftry> There is one for each image (3) Can you post the code for the submission form? George At 10:20 AM 5/26/2004, Monique Boea wrote: ----- Excess quoted text cut - see Original Post for more -----   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
George Abraham
05/26/2004 10:35 AM

Ah sorry, I meant the code for the form page, not the action page. So the page just before this one. George At 10:26 AM 5/26/2004, Monique Boea wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Monique Boea
05/26/2004 10:42 AM

sorry, it's long <form action="cobranding_proc.cfm" method="post" enctype="multipart/form-data" onsubmit="return validateform();"> <table width="600" cellpadding="0" cellspacing="0" border="0"> <tr>   <td width="100" align="left"> </td>   <td width="500" align="right"> </td> </tr> <tr>   <td><b>Label:</b></td>   <td><cfoutput><input type="text" name="tScreenLabel" maxlength="100" size="50" value="#htmlEditFormat(variables.tScreenLabel)#"></cfoutput></td> </tr> <tr>   <td><b>Logo:</b> </td>   <td><cfoutput><input type="file" name="tLogoFilename" maxlength="50" size="50"></cfoutput></td> </tr> <tr>   <td height="5" colspan="2"> </td> </tr> <tr><td></td>   <td><b class="mep">Image size must be 187 X 62 (W x H) pixels </b> </td>    </tr> <tr>   <td height="10" colspan="2"> </td> </tr> <cfif variables.tLogoFilename is not ''> <tr>   <td>    <a href="cobranding_proc.cfm?action=delete&object=tLogoFilename">remove - ></a>   </td>   <td align="left"><cfoutput><img src="../media/images/clientlogos/#variables.tLogoFilename#"></cfoutput></td> </tr> </cfif> <tr>   <td colspan="2"> </td> </tr> <tr>   <td><b>Header Background Image:<br> </b></td>   <td><cfoutput><input type="file" name="tHeaderBGFilename" maxlength="50" size="50"></cfoutput></td> </tr> <tr><td></td>   <td><b class="mep">Image size must be 36 pixels high (MAX) </b> </td>    </tr> <tr>   <td height="10" colspan="2"> </td> </tr> <cfif variables.tHeaderBGFilename is not ''> <tr>   <td>    <a href="cobranding_proc.cfm?action=delete&object=tHeaderBGFilename">remove - ></a>   </td>   <td align="center" height="36">   <cfoutput>   <table border="0" cellpadding="0" cellspacing="0" width="300">    <tr>     <td width="5"><img src="../media/images/menu/#variables.tHeaderBGFilename#"></td>     <td width="20" valign="middle" align="center"> = </td>     <td width="*" background="../media/images/menu/#variables.tHeaderBGFilename#"> </td>    </tr>   </table>   </cfoutput>   </td> </tr> </cfif> <tr>   <td height="20" colspan="2"> </td> </tr> <tr>   <td colspan="2"><b>Header Color Code (EX: #12250P):</b> <cfoutput>   <input type="text" name="tHeaderBGColor" value="#variables.tHeaderBGColor#" maxlength="50" size="10"></cfoutput>   </td>   </tr> <tr>   <td colspan="3"><a href="javascript:Start('colorcodes.html')";>Click here to open color chooser.</a></td>    </tr> <tr>   <td height="20" colspan="2"> </td> </tr> <cfif variables.tHeaderBGColor is not ''> <tr>   <td colspan="2" <cfoutput>bgcolor="#variables.tHeaderBGColor#"</cfoutput> width="10"> </td> </tr> </cfif> <tr>   <td colspan="2"> </td> </tr> <tr>   <td><b>Header Foreground Image:</b></td>   <td><cfoutput><input type="file" name="tHeaderFGFilename" maxlength="50" size="50"></cfoutput></td> </tr> <tr><td></td>   <td><b class="mep">Image size must be 36 pixels high (MAX) </b> </td>    </tr> <tr>   <td height="10" colspan="2"> </td> </tr> <cfif variables.tHeaderFGFilename is not ''> <tr>   <td>    <a href="cobranding_proc.cfm?action=delete&object=tHeaderFGFilename">remove - ></a>   </td>   <td align="center"><cfoutput><img src="../media/images/menu/#variables.tHeaderFGFilename#"></cfoutput></td> </tr> </cfif> <tr>   <td colspan="2"> </td> </tr> <tr>   <td>Link 1 Label:</td>   <td><cfoutput><input type="text" name="tURL1label" maxlength="100" size="50" value="#htmlEditFormat(variables.tURL1Label)#"></cfoutput></td> </tr> <tr>   <td>Link 1:</td>   <td><cfoutput><input type="text" name="tURL1" maxlength="200" size="30" value="#htmlEditFormat(variables.tURL1)#"></cfoutput> <http://www.balser.com> </td> </tr> <tr>   <td colspan="2"> </td> </tr> <tr>   <td>Link 2 Label:</td>   <td><cfoutput><input type="text" name="tURL2label" maxlength="100" size="50" value="#htmlEditFormat(variables.tURL2Label)#"></cfoutput></td> </tr> <tr>   <td>Link 2:</td>   <td><cfoutput><input type="text" name="tURL2" maxlength="200" size="30" value="#htmlEditFormat(variables.tURL2)#"></cfoutput> <http://www.balser.com> </td> </tr> <tr>   <td colspan="2"> </td> </tr> <tr>   <td>Link 3 Label:</td>   <td><cfoutput><input type="text" name="tURL3Label" maxlength="100" size="50" value="#htmlEditFormat(variables.tURL3Label)#"></cfoutput></td> </tr>   <tr>   <td>Link:</td>   <td><cfoutput><input type="text" name="tURL3" maxlength="200" size="30" value="#htmlEditFormat(variables.tURL3)#"></cfoutput>< <http://www.balser.com> td> </tr> <tr>   <td colspan="2"> </td> </tr> <tr>   <td colspan="2" align="center">    <br><br><input type="submit" value="Submit">          <input type="button" value="Cancel" onclick="javascript:parent.location.href='menu.cfm';">    <cfoutput>     <input type="hidden" name="action" value="add_edit">     <input type="hidden"  name="editflag" value="#variables.editflag#">     <input type="hidden" name="textension" value="">     <input type="hidden" name="tBGextension" value="">     <input type="hidden" name="tFGextension" value="">    </cfoutput>   </td> </tr> </table> </form>

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Greg Luce
05/26/2004 12:51 PM

Get rid of the cftry and cfcatch for now so you can see why the cffile operation isn't working. The CF error should tell you what's wrong. Greg <cftry>     <!--- upload new file --->     <cffile action="upload" filefield="form.tLogoFilename" destination="#variables.home_dir#media\images\clientlogos\#variables.tLogoFi lename#" nameconflict="overwrite">    <cfcatch>     <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">     alert("Error uploading Logo file.  Please try again.");     history.go(-1);     </SCRIPT>     <cfexit>    </cfcatch>    </cftry> There is one for each image (3) Can you post the code for the submission form? George At 10:20 AM 5/26/2004, Monique Boea wrote: ----- Excess quoted text cut - see Original Post for more -----   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Damien McKenna
05/26/2004 10:32 AM

On May 26, 2004, at 10:20 AM, Monique Boea wrote: > Combing the three into one cffile with a loop? That's what I'm thinking.. eg <cffile ....> <cfoutput query="cffile">   #cffile.clientFileName#<br /> </cfoutput> -- Damien McKenna - Web Developer - dmckenna@thelimucompany.com The Limu Company - http://www.thelimucompany.com/ - 407-804-1014

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Philip Arnold
05/26/2004 11:03 AM

----- Excess quoted text cut - see Original Post for more ----- I've run upto 10 on the same page without problems (apart from users clicking Submit more than once :P), so I know the functionality will work > <cffile action="upload" filefield="form.tLogoFilename" Remove the "form." from the filefield, it's not needed or wanted Try this: Name the 3 fields as "FileUpload_1", "FileUpload_2" and "FileUpload_3" Then run your code with a <cfloop around them Also, your JS will only report one error before exiting the template (your <cfexit>) I'd also suggest displaying the message on the page, and then offering a link back - it will give the opportunity to show more than one message at the same time, rather than one popup Not forgetting that your popup doesn't say which image failed HTH

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/26/2004 10:51 AM

For the filefield attribute, you need the name of the <input type="file">. The destination attribute has to be a directory (not a file!). You can find out the name of the uploaded file with #cffile.serverFile#. <cffile action="upload" filefield="tLogoFilename" destination="#variables.home_dir#media\images\clientlogos\" nameconflict="overwrite"> ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ben Doom
05/26/2004 12:47 PM

> The destination attribute has to be a directory (not a file!). You can > find out the name of the uploaded file with #cffile.serverFile#. ??? From the CFML reference: Absolute pathname of directory or file on web server..... I know in the past I've used a filename here. --Ben Doom

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tangorre, Michael
05/26/2004 01:34 PM

> Get rid of the cftry and cfcatch for now so you can see why > the cffile operation isn't working. The CF error should tell > you what's wrong. > > Greg Or, <cfcatch> <cfdump var="#cfcatch#"> <cfabort> <cfcatch>

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/26/2004 01:53 PM

In my reference (cfmx): "Pathname of directory in which to upload the file. If not an absolute path (starting a with a drive letter and a colon, or a forward or backward slash), it is relative to the ColdFusion temporary directory, which is returned by the GetTempDirectory function." I have never actually tried to specify the filename too. ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ben Doom
05/26/2004 02:23 PM

> In my reference (cfmx): > "Pathname of directory in which to upload the file. If not an absolute > path (starting a with a drive letter and a colon, or a forward or > backward slash), it is relative to the ColdFusion temporary directory, > which is returned by the GetTempDirectory function." > > I have never actually tried to specify the filename too. Wierd.  I'm looking at the MX reference, as well.... --BenD

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/26/2004 02:27 PM

http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-p35.htm#wp35 40091 I am not at all saying you are wrong. As I said, I haven't tried it with a filename. Pascal > > Wierd.  I'm looking at the MX reference, as well.... > > --BenD

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Monique Boea
05/26/2004 03:21 PM

My CFFILE issue is resolved. The previous developer defined the file extensions as hidden values and passed them as ""....and it was not recognizing the other two file extensions. So my images were being uploaded without the .gif or .jpg Why he'she wouldn't just upload the file name, I don't know... But I resolved it with the following: <cfset variables.textension = Right(form.tLogoFilename,3)> http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-p35.htm#wp35 40091 I am not at all saying you are wrong. As I said, I haven't tried it with a filename. Pascal > > Wierd.  I'm looking at the MX reference, as well.... > > --BenD   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Philip Arnold
05/26/2004 03:27 PM

> From: Monique Boea >   > <cfset variables.textension = Right(form.tLogoFilename,3)> Be careful about this - some people save images as .jpeg

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Monique Boea
05/26/2004 03:34 PM

YIKES!! > <cfset variables.textension = Right(form.tLogoFilename,3)> Be careful about this - some people save images as .jpeg   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/26/2004 03:37 PM

yeah, you might want to to a <cfset variables.textension = listFirst(form.tLogoFilename ,'.')> or some variation of those arguments inside the function.. tw YIKES!! > <cfset variables.textension = Right(form.tLogoFilename,3)> Be careful about this - some people save images as .jpeg   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Philip Arnold
05/26/2004 03:42 PM

> From: Tony Weeg > > yeah, you might want to to a > > <cfset variables.textension = listFirst(form.tLogoFilename ,'.')> > > or some variation of those arguments inside the function.. Don't you mean ListLast()? Some lovely people put full-stops in their file names as well

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Monique Boea
05/26/2004 03:54 PM

full-stops? > yeah, you might want to to a > > <cfset variables.textension = listFirst(form.tLogoFilename ,'.')> > > or some variation of those arguments inside the function.. Don't you mean ListLast()? Some lovely people put full-stops in their file names as well   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/26/2004 04:08 PM

image.name.jpeg .......^ = full stop? maybe? I don't know. full-stops? > yeah, you might want to to a > > <cfset variables.textension = listFirst(form.tLogoFilename ,'.')> > > or some variation of those arguments inside the function.. Don't you mean ListLast()? Some lovely people put full-stops in their file names as well   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Philip Arnold
05/26/2004 04:50 PM

> From: Monique Boea > > full-stops? Same as a Period http://dictionary.reference.com/search?q=full%20stop

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/26/2004 04:07 PM

sure did :) > yeah, you might want to to a > > <cfset variables.textension = listFirst(form.tLogoFilename ,'.')> > > or some variation of those arguments inside the function.. Don't you mean ListLast()? Some lovely people put full-stops in their file names as well

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Monique Boea
05/26/2004 03:39 PM

So what's the alternative? > <cfset variables.textension = Right(form.tLogoFilename,3)> Be careful about this - some people save images as .jpeg   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Monique Boea
05/26/2004 03:40 PM

ACtually, there is Javascript on the previous page that forces a three digit file extension. (BOOYAH!!) :) > <cfset variables.textension = Right(form.tLogoFilename,3)> Be careful about this - some people save images as .jpeg   _____  

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Adkins, Randy
05/26/2004 03:48 PM

On the action page make sure you are specifying three different form fields for the upload. Paste your action script and we can help more I have a CFFILE question: I have a form which allows a user to upload three different images at the same time I have three different <cffile action="upload".... tags on the processing page. The problem is it only uploads the very first image... Any suggestions?   _____  

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jerry Johnson
05/26/2004 04:26 PM

I think full stops are periods. He might just be reminding you that there can be more than one period in the filename. a.1.b.2.c.jpeg Windows treats anything to the right of the final period as the extention. And it may be more than 3 characters long. Jerry Johnson

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/26/2004 04:29 PM

so, the htought was that listLast() would get the files extension, regardless of the amount of (class can we all say our new word) "full stops", that are present in the filename. :) new word learned. cool! tw I think full stops are periods. He might just be reminding you that there can be more than one period in the filename. a.1.b.2.c.jpeg Windows treats anything to the right of the final period as the extention. And it may be more than 3 characters long. Jerry Johnson

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Philip Arnold
05/26/2004 04:49 PM

> From: Tony Weeg > > so, the htought was that listLast() would get the files > extension, regardless of the amount of (class can we all say > our new word) "full stops", that are present in the filename. It will, but I've seen code where somebody used ListFirst() on the period, and it fails horribly when people put full stops in the middle of a file name


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

February 09, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       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