If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Automatically Saving An Excel File

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-07-12, 02:37
mahesh.sanka mahesh.sanka is offline
Registered User
 
Join Date: Aug 2011
Posts: 2
Smile Automatically Saving An Excel File

Hi,

I am using the follwoing code for generating an Excel file

Code:
HttpContext.Current.Response.Clear()
            HttpContext.Current.Response.ClearContent()
            HttpContext.Current.Response.ClearHeaders()
            HttpContext.Current.Response.Charset = ""
            HttpContext.Current.Response.Buffer = True
            HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"
            HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + lstrExcelFileName)

            HttpContext.Current.Response.Write(_strBuild)

            HttpContext.Current.Response.Flush()

            HttpContext.Current.Response.End()
the above code works well,but it is prompting the user for saving an excel file.
I dont want that . Is there any mechanism for saving an excel file with out prompting the user
Reply With Quote
  #2 (permalink)  
Old 02-07-12, 03:46
mahesh.sanka mahesh.sanka is offline
Registered User
 
Join Date: Aug 2011
Posts: 2
Smile Automatic Saving an Excel File

May I Know whether it is possible or not
Reply With Quote
  #3 (permalink)  
Old 02-09-12, 14:49
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
You cannot force files onto a user's computer through a browser without their knowledge.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On