Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a link that opens an excel file and deletes the file after

Status
Not open for further replies.

GraciePoo

Technical User
Mar 16, 2001
15
US
I need to create a link that will open an excel file on the server. Everytime the excel file is opened, it keeps saving a temp file to the user's temp directory. I want it set such that upon closing the file, the temp excel file is deleted.

I know this involves CFCONTENT and whatnot, but I'm not sure as to how to use it. Thanks in advance.
 
To clear up any confusion that might exist, I'll reiterate:

I setup a link to an excel file that exists on the server. A simple "a href" tag was all I used. Upon clicking the link, the excel file named originally "workbook.xls" is brought up. The name of the file brought up is also "workbook.xls". Upon exiting excel normally, "workbook.xls" gets saved to the user's temp directory, usually C:\Temp. If the user brings up the file again by clicking on the same link, the same workbook comes up except it's named some gibberish like "VULQGR7C.xls". Again, upon exiting excel normally, the workbook, this time named "VULQGR7C.xls" gets saved to the user's temp directory. The files never get deleted and more of these gibberish named files appear in the user's temp directory upon exiting the excel file.

::Confuzzled::
 
Hey Gracie,

There's no way you can use CF to delete files on the visitor's PC. The only thing you might be able to do is use the <cfcontent> tag to return the file instead of using a direct link as this might cause Excel not to save a .tmp file. You might also try using different mime types with cfcontent and see if one works better. I believe there are several mime types for Excel such as .xlc,.xls, etc...

I think that ultimately you are dealing with an Excel issue and will be limited as to what you can do with CF to fix it.

Good luck,
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top