.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 3rd, 2001, 11:06 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Downloading a comma delimited file???

<i><b>Originally posted by : Liat (Liat@hotmail.com)</b></i><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 />

Reply With Quote
  #2  
Old June 7th, 2001, 07:53 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
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 />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > Downloading a comma delimited file???


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT