.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

File Download does not continue after IE Security warning

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :ASP.Net
Hello. First let me give a reference to my code which is in another post  http://forums.asp.net/t/1600899.aspx I'm running into an issue where in IE the security dialog is popping up and if I click download File the file is never downloaded..it just goes back to the main page. I'm using a web service to generate the file on disk and then setting the src of the iframe to the file..I also tried an alternate approach of setting the src of the frame to an aspx page that pretty much does the following:  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim file As String = Request.QueryString("file") Response.Clear() Response.ClearHeaders() Response.BufferOutput = False Response.ContentType = "application/zip" Response.AddHeader("content-disposition", "attachment; filename=" + file) Response.TransmitFile(file) Response.Close()     works fine in firefox but not IE...

View Complete Post

More Related Resource Links

how to know when a user finish his file download successfully ?


hi all

i am doing a page to sell files online

 the paying method is by a card or bank account and the customer is not registered to the site so i want to make sure that the customer has downloaded the file successfully after that the system completes the payment operation

so if there is any way to know do that tell me please

i use c# thanx all



Resource File: Web Services Security Specs and TrustBridge


WS-Security is a recently proposed specification from Microsoft, IBM, and VeriSign. It has been submitted to OASIS for industry standardization. WS-Security builds on the SOAP specification to provide you with a standard mechanism to exchange secure, signed messages in a Web Services environment.

MSDN Magazine October 2002

File Download Problem


Hi everyone,

I am using a download handler to handle the downloading of files from my website.  I am using a slightly modified code from the Microsoft article http://support.microsoft.com/kb/812406

Everything is working fine and downloading, even with large files, but it does not show the file size for any of the files to download. Even if theyre really small.

Here is my code for the handler

public class DownloadHandler : IHttpHandler

        public void ProcessRequest(HttpContext context)
            string path = "";
                path = context.Server.UrlDecode(context.Request.QueryString["src"]).DecryptString();
            catch(Exception ex)
            System.IO.Stream iStream = null;

            byte[] buffer = new Byte[10000];

            int length;

            long dataToRead;

            string filename = System.IO.Path.GetFileName(path);

                iStream = new System.IO.FileStream(context.Server.MapPath("~/" + path), System.IO.FileMode.Open,
                            System.IO.FileAccess.Read, System.IO.FileShare.Read);


Problem download file from SQL Server


Hello everyone. I am having an issue downloading files that I have store in SQL Server. I have no problem in a WinForm. What am I doing wrong in my code?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim sch As New clsReport
        Dim fileData As New clsReport.Letter
        fileData = sch.DownloadLetter(Session("LetterID"))
        Dim ms As System.IO.MemoryStream = fileData.fil

        Dim fil As Byte() = ms.ToArray
        Dim nam As String = fileData.name
        Dim ext As String = fileData.ext
        If Not fil Is Nothing Then
                ' Response.Clear()
                Response.AppendHeader("Content-Disposition", "attachment; filename=" + nam & "." & ext)
                ' Response.AddHeader("Content-Disposition", nam & "." & ext)
                Response.AddHeader("Content-Length", fil.Length.ToString)
                Response.ContentType = "Application/octet-stream"
                Response.Buffer = True
            Catch ex As Exception
            End Try

        End If

    End Su

The file reached the maximum download limit. Check that the full text of the document can be meaning



I'm facing an issue with the indexing.

I have 1 WFE+Index server+DB server.

Index server is not installed with MS FIlter pack 1.0

When crawling, the there will be document with warning in crawl log:
The file reached the maximum download limit. Check that the full text of the document can be meaningfully crawled.

Documents that with warning are such as doc, ppt, xls, docs, ppts and many others.
However, I view into the successful crawled document, there are doucments with ext doc and ppt.

For large file index, there are MaxGrowthFactor + MaxDownLoadSize required to be added into the index server.

As my understanding is, MS Filter Pack should installed into index server(already did, correct me if i'm wrong).

I looked into the Office SharePoint Seach(CA>Services in farm), if the server is appointed to "Use this server as indexing server", then MS Filter Pack is suppose to be installed into that particular server as well.

At the bottom, there also has another option is "Use all web front end for crawling".

The question here is, IF the option "Use all web front end for crawling" is selected.
Does the WED FRONT END Server required to installed the Ms Filte

10 MB File Download In ASP.NET Socket Error

Hi,I received the following error message, when downloading file of 10 MB. Please let me know the solution. I already configured the httpRuntime value to <httpRuntime maxRequestLength="10250 " executionTimeout="1000". Still I am getting the error message.The description for Event ID ( 0 ) in Source (XXXXX) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Unable to read data from the transport connection: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. Source: mscorlib TargetSite: Void HandleReturnMessage(System.Runtime.Remoting.FileUploading.IFileUpload, System.Runtime.Remoting.FileUploading.IFileUpload) StackTrace: Server stack trace:    at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)   at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)   at System.IO.BinaryReader.ReadBytes(Int32 count)   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArrayAsBytes(ParseRecord pr)   at System.Runtime.Seri

Download a file from web and save dialog box for path

Hi I need to download a exe file from a web site. I need to prompt a savedialog box for the user to select a path to save it. This the code i have. How can i show a save dialog box here?         Private Sub downloadfile()         Dim client As New Net.WebClient         client.DownloadFile("www.mysite.com/Information/Myexe.exe", "Sr.exe")     End Sub Thanks

How to initiate a file download from withing UpdatePanel?

Hi all, I'm building dynamically a series of ImageButton controls, and I want to assign them a hyperlink for downloading files. So say you got a dropdownlist of 3 items 1,2 and 3, if you select 1 it creates one imagebutton and pointrs to fileA, if you select 2 it creates two imagebuttons and the first one points to fileA and the second one to fileB and so on... Everything is wrapped in an UpdatePanel to avoid postbacks. I have a problem binding the download link in the ImageButton.navigateurl, and then downloading it. I don't know how to do it...   protected void Button1_Click(object sender, EventArgs e)    {        Panel myPanel = (Panel)UpdatePanel1.FindControl("Panel1");             string[] Uploaders = new string[CheckBoxList1.Items.Count -1];        for(int i = 0; i < CheckBoxList1.Items.Count; i++)        {            if(CheckBoxList1.Items[i].Selected)                  Uploaders[i] = CheckBoxList1.Items[i].Text;         }              my

Client download .csv file from server using Response.TransmitFile

I am using the code below to enable clients to download a .csv file from my server.The problem I am having is that when the file is saved to the client computer the file name is prefixed and suffixed with an underscore which leads to a file type of .csv_ which is obviously not a recognised file type.How can I strip the underscores from the file name at the transmit stage?        Dim FileName As String = LstBox1.SelectedItem.ToString        Dim FilePath As String = "~/temp" & FileName        Response.Clear()        Response.ContentType = "text/csv"        Response.AddHeader("Content-Disposition", "attachment; filename=\" & FileName & "\")        Response.TransmitFile(FilePath)        Response.End() 

how to check one time java script file download not every session

how to check one time java script file download not every session

Membership as a security/administration model for upload/download of documents

Hi community, I'm working on a website where it should be possible for registered users to upload word documents. The administration of users is done through Membership and Profiles. When the documents have been uploaded, the following needs to be achieved: Non-registered users should not be allowed to download documents I should be able to control which users that has access to which documents I should be able to register which user downloads which documents I should be able to track how many times a document has been downloaded Can this be achieved be using Membership and Profiles? Thanks in advance Best regards Phecdaret

IE8, AJAX and SSL - Solution to mixed content security warning!

 Hi everyone, I've searched this forum and the web for an answer to my problem, but haven't quite found the answer. My corporate site is using Asp .Net 3.5, AJAX and SSL to secure certain pages. The problem is that IE8 throws a message about unsecure content while IE7 and Firefox do not. I know this issue has been discussed ad nauseum (remember, I've done a lot of research), however, I have specifically isolated the issue down to adding the <scriptmanager> control on an AJAX page requiring SSL. With nothing else on the page (e.g. no images or script references), just a simple .aspx page, add <scriptmanager> and IE8 will display the message and IE7 and FF will not.  Based on my reasearch, the issue is most likely related to the scriptresource and webresource handlers, however, I don't know enough about the inner workings to do any good. Here's what I tried... Manually set the scriptpath property of scriptmanager to specify where to find the AJAX scripts. The scriptmanager uses the system.web.extensions assembly (which packages all the AJAX js), so I manually downloaded the library from ajax.asp.net site, copied the js files to a scripts directory and made reference in the scriptmanager directly.  Using Fiddler2, I could see that the references now appear to be SSL, and I know it was working because

Prompt for "File Download" on Page Viewer Web part pointing to .htm file

I am in the process of moving my 2007 site over to 2010. On some of my sites I have a page viewer web part that points to a .htm file. It works great in 2007, but in 2010 I get a "File Download" prompt. Any ideas? Thanks --tolga

code of file download

Dear friends,       Please send me a code of file downloading in ASP.NET with VB       Thanks, PIYUSH              

Force File Download on a Remote File Server

Hi!I'm trying to force a large (200+ MB) file to download that's on a remote server. The problem is that I can't use the "WriteFile()" function, since I'm not using a virtual path.Then, when I try:Response.AppendHeader("content-disposition",                 "attachment; filename=" + name);Response.AppendHeader("content-disposition", "attachment; filename=" + name);I get a file that has the correct name and extension, but is 0KB. Can someone please help me?!Thanks!-Eric

Resetting a File's Security

Hi, I've got a routine that tries to import files from an import directory, spitting them out to an Error directory if the import fails.  The Error dicretory is shared and users have access permissions to delete files in there, so they can try to fix the problems and then move the files off to the import directory again.  I use File.Move to move the files to the Error directory and this is working fine, apart from the permissions - it seems to revert to a defaul set of permissions and so the users can't remove the files - how can I reset the permissions on the file to those of the parent directory?  I've tried poking around with SetAccessControl and SetAccessRuleProtection but I don't seem to be having any luck? Cheers MH
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend