
June 7th, 2001, 07:53 AM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
<i><b>Originally posted by : Ajay Dhunna (Ajay@AimproNet.com)</b></i><br />Try the following:<br />a) Rename the extension to .CSV<br /><br />b) replace the line which says <br />Response.Redirect "../Uploads/" & sFileName To<br />Response.write ("<script language=javascript>window.location='" & "../Uploads/" & sFileName & "'</script>")<br /><br />c) Sometimes when you get adownload buttons there's a checkbox which says something like ALWAYS OPEN. Maybe you ticked this once and you need to find out how to untick it which i don't know how to get to it.<br /><br />Rgds<br /><br />------------<br />Liat at 6/3/2001 9:06:15 PM<br /><br />I have this code that creates a file and I'm trying to use the Response.Redirect to make it download the file. But instead of d/l it simply prints it to the screen. Please HELP - how do I make it d/l it??? here is the code... <br /><br /><br />Sub CreateFile (sFileName,sFlag,sTextToWrite) <br /><br />Dim sFullFileName <br />Set FSObj = SERVER.CreateObject("Scripting.FileSystemObject")'Create the Object <br />LocationOfCDFiles = Server.MapPath("/") & """ & "uploads""' <br />Randomize 'Initialise rnd <br />sFileName= sFileName & Int((200 * Rnd) + 1) & ".DAT" 'Filename + a random number from 1-200 <br />sFullFileName = LocationOfCDFiles & sFileName <br />Set FileObj = FSObj.CreateTextFile(sFullFileName, sFlag) 'Create the File <br />FileObj.writeline(sTextToWrite) 'Write to file <br />FileObj.Close <br />Set FSObj = Nothing <br />Set FileObj = Nothing <br />Response.Redirect "../Uploads/" & sFileName <br />End Sub <br /><br /><br />
|