Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
jjay@aus #1
<cfcontent> deletefile parameter problem
I am using cfheader and cfcontent to deliver a dynamically generated excel
document to the browser. On delivery of the excel document I want to delete it
from the server using the cfcontent tags deletefile parameter, but whenever I
add that paramater and set it to yes, I am receiving the following error
(embedded in the excel document). 'Error occurred while attempting to delete
the file
C:\Inetpub\wwwroot\asa\administration\members\memb er_lists\MbrList_050415.xls.'
Here is my code:
------------------------------------------------------------------- ..query
getting data... ... using <cffile.. to create .xls document.... .. then
outputing with <cfheader name='Content-Disposition'
value='filename=#FileName#'> <cfcontent type='application/unknown'
file='#FileLocation##FileName#' deletefile='Yes'>
------------------------------------------------------------------- Any
suggestions on why I might be getting this error ?? Many thanks in advance.
jjay@aus Guest
-
problem downloading using CFCONTENT & CFHEADER
I am running into the same problem. Please reply if you find any fix to this problem. Thanks -
cfcontent problem
my codes is like this: <table> <tr> <td>Hello World</td> </tr> </table> <cfcontent file="image/image.jpg" type=".........jpeg......."> and... -
cfcontent filename problem
Hello all- I'm trying to use cfcontent to force the download of an exe. The problem is that when the save to disk dialog box opens, the filename... -
DateFormat and cfcontent problem
I wonder why the following will not output to msword: -------------------------------------------------------------------------------- ----------... -
DeleteFile doesn't work in Session_OnEnd???
I can successfully delete files using fso.DeleteFile when in an ASP script. But in Session_OnEnd, where I'd *really* like to clean up files, it... -
mratner #2
Re: <cfcontent> deletefile parameter problem
I'm Getting the SAME EXACT problem. And it's a recent problem. Could it be a
hot fix that was updated to windows 2000 server?
it works a while on reboot, and then just starts giving that error again. NT
ERROR 5 and cannot delete the file after
the CFCONTENT is displayed.
What a pain. Some macromedia help would be nice!
mratner Guest
-
SpiderFromMars #3
Re: <cfcontent> deletefile parameter problem
Hi There, I would be very interested in learning how to use CFFILE/CFCONTENT
to create/display an EXCEL document. Would you mind sharing the code? The way
that I create XLS sheets now is by: 1) Writing comma seperated values to a
file using CFFILE 2) Use CFLOCATION or JavaScript to open the file created by
merely using the filename. I've never had any problems using this technique,
but I would like to learn how you are using it and what the pitfalls are of
doing it the way that I have been.... Kind Regards, Peter
SpiderFromMars Guest
-
jjay@aus #4
Re: <cfcontent> deletefile parameter problem
Hi Peter, I have gone back to using cflocation as well. I just had too many
problems with cfcontent (see my other topic I posted after this one). What I
do do differentl to you however is when creating the file, I use HTML to create
document (using cffile) and save it directly with a .xls extension. This
allows for greater control over the formatting of headings etc.. Again, check
out the other topic I posted after this one to see a code sample.
jjay@aus Guest
-
SpiderFromMars #5
Re: <cfcontent> deletefile parameter problem
Very interesting code. So, if you save it as EXCEL, it is apparent that <TD>'s
are counted as columns and <TR>'s act as rows. I'll give this a try and see
how it comes out... the only difference is that I'll use CFLOCATION vice
CFHEADER.... <cfheader name='Content-Disposition' value='inline;
filename=File.xls'> <cfcontent type='application/unknown'> <table
border=1><tr><td><b>Member
No.</b></td><td><b>Category</b></td><td><b>Name</b></td><td><b>Address
1</b></td><td><b>Address 2</b></td><td><b>Address
3</b></td><td><b>City</b></td><td><b>State</b></td><td><b>Postcode</b></td><td><
b>Country</b></td></tr> <cfoutput query='Members'>
<tr><td>#member_number#</td><td>#description#</td><td>#name#</td><td>#address_1
#</td><td>#address_2#</td><td>#address_3#</td><td>#address_city#</td><td>#addres
s_state#</td><td>#address_postcode#</td><td>#address_country#</td></tr>
</cfoutput> </table>
SpiderFromMars Guest
-
jjay@aus #6
Re: <cfcontent> deletefile parameter problem
That's right. You can also use a lot of other HTML Formatting such as <b> tags
and styles. A good way to get styles is to open an excel document, style it
how you like it and then view the source for the excel document (save as a .txt
and open n notepad or something) and pull out the style code to then use when
writing your file.
jjay@aus Guest
-
michael.manganelli@citigroup.com #7
Re: <cfcontent> deletefile parameter problem
I have a problem with the delete parameter. I set to 'Yes' and it
doesn't delete the file.
I have seen 'application/unknown' used for the cfcontent type
parameter.
Some of the information I have come across besides unknown and
specifically related to Excel applications also uses the following:
vnd.ms-excel x-msexcel ms-excel msexcel and x-excel
Where can I find out what the differences are between these values?
Is my problem even related to the type parameter?
My Code follows:
<cfcontent type="application/vnd.ms-excel"
File="#newTemplate#"
deletefile = "YES">
Thanks!
michael.manganelli@citigroup.com Guest
-
michael.manganelli@citigroup.com #8
Re: <cfcontent> deletefile parameter problem
I have a problem with the delete parameter. I set to 'Yes' and it
doesn't delete the file.
I have seen 'application/unknown' used for the cfcontent type
parameter.
Some of the information I have come across besides unknown and
specifically related to Excel applications also uses the following:
vnd.ms-excel x-msexcel ms-excel msexcel and x-excel
Where can I find out what the differences are between these values?
Is my problem even related to the type parameter?
My Code follows:
<cfcontent type="application/vnd.ms-excel"
File="#newTemplate#"
deletefile = "YES">
Thanks!
michael.manganelli@citigroup.com Guest
-
SpiderFromMars #9
Re: <cfcontent> deletefile parameter problem
Hi Jjay@aus,
I've been playing with saving HTML files out with XLS extensions and have been
having a brilliant time.
But, I am having problems with background colors that maybe you can help me
with.
Can you please take a minute to check out this code and open it in EXCEL?
You'll see (hopefully) that the blue background goes all the way across the
spreadsheet and does not keep itself in the cells that have content.
How can I change the HTML to get the blue background color to stay where it
logically should be staying.
Thanks for any help you can give me...
Peter
---------The Code -------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>TOPIC Page Modification Report</title>
<style type="text/css">
<!--
table {
border: 1px solid #000000;
}
td {
border: 1px solid #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
th {
border: 1px solid #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
}
-->
</style>
</head>
<body>
<table width="660px">
<tr bgcolor="33CCFF" style="font-size: 16px; font-weight: bold;">
<td colspan="2">FMIS Project</td>
<td>Size</td>
<td>Date Last Modified</td>
</tr>
<tr bgcolor="33CCFF" style="font-size: 16px; font-weight: bold;">
<td colspan="4">
Total Number of Pages: 1
</td>
</tr>
<tr>
<td>1</td>
<td>\FMIS\FMIS.cfm</td>
<td>11557</td>
<td>13/06/2002 11:10</td>
</tr>
</table>
<br><br>
</body>
</html>
SpiderFromMars Guest
-
jjay@aus #10
Re: <cfcontent> deletefile parameter problem
Hi Peter, try specifying the bgcolor for each cell rather than the row (see
code below). You could probably do it with styles as well, but as exel is a
microsoft product it will probably be some long convoluted 300 char style
setting.
This way is probably the easiest.
Cheers
----------------------------
<table width="660px">
<tr style="font-size: 16px; font-weight: bold;">
<td bgcolor="33CCFF" colspan="2">FMIS Project</td>
<td bgcolor="33CCFF">Size</td>
<td bgcolor="33CCFF">Date Last Modified</td>
</tr>
<tr style="font-size: 16px; font-weight: bold;">
<td bgcolor="33CCFF" colspan="4">
Total Number of Pages: 1
</td>
</tr>
<tr>
<td>1</td>
<td>\FMIS\FMIS.cfm</td>
<td>11557</td>
<td>13/06/2002 11:10</td>
</tr>
</table>
jjay@aus Guest
-
SpiderFromMars #11
Re: <cfcontent> deletefile parameter problem
That worked perfectly! Thank you!!
It was all a matter of doing it at the cell level... not the row level.
Then there was much rejoicing.... yey!!
Peter
SpiderFromMars Guest



Reply With Quote

