.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 chunking fails when served from IIS7 to firefox

Posted By:      Posted Date: October 16, 2010    Points: 0   Category :ASP.Net

This seems as good a place as any for this question.  It has to do with an .ASHX handler.

I have written a generic file serving handler in asp.net/vb.net - it has been working great.  I recently moved to a windows 7 box and am now debugging under IIS7, and this is where the problems occure.

Whenever I serve a file to either FireFox or Chrome (IE8 works fine) from IIS 7, the download will fail. 
- In FireFox the error is "[some file name and path].part could not be saved, because the source file could not be read."
- In Chrome the error is "Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error."
- In IE8 it works fine

If I run the same code in IIS6, it works fine.
If I run the same code in the Visual Studio virtual web server, it works fine (on windows 7 or XP).

I am rather concerned about this as our production web server will soon be IIS7; which I'm starting to really love, and would hate to revert to IIS6 just because this won't work in IIS7.

View Complete Post

More Related Resource Links

Using response.outputstream.write to stream large file fails in firefox



I have some code to stream files (for security of the files), the code works for all files in IE, and small files in firefox. but If the file is large (eg 750Mb) firefox hangs before it shows the open/save dialog box. 

However if i take out response.clearheaders and the response.flush in the code it does download but all the files downloaded by firefox are corrupt because the file size is too large.   Filenames are guids but I took the "-" out incase that was an issue.

If any one can shed some light on this I would be very grateful.

Function is Below. 


Private Sub StreamFile(ByRef response As HttpResponse, ByVal sFile As String)
            Dim fs As FileStream = Nothing
            Dim sFileName As String = Path.GetFileName(sFile)

            Dim oFile As New FileInfo(sFile)

                fs = New FileStream(sFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)

            Catch ex As Exception

            End Try


            'response.ClearHeaders() 'makes file size wrong in firefox
            response.AddHeader("Content-Length", oFile.Length)
            'To forcefully download, even for Excel, PDF files, reg

Javascript fails in chrome and firefox, works fine in IE



I am customizing Newform.aspx i.e. hiding some fields, making other readonly etc. It works fine in IE but fails miserably in chrome and firefox i.e. readonly are no more readonly, hidden are no more hidden. Here is my code:

<script language="javascript" type="text/javascript">
    function autoFillFields()
       var ctrl = findacontrol("Reference Customer");
    var param = getURLParam('RefFromCust');   
    var properParam = replaceCharacters(param);
    ctrl.value = properParam;
    var ctrl = findacontrol("RefReqOpptyId");
    var param = getURLParam('OpptyId');   
    var properParam = replaceCharacters(param);
    ctrl.value = properParam;

    param = getURLParam('RefFromAE');
    properParam = replaceCharacters(param);
    setPeoplePicker("People Picker", properParam);
    hideFldCtrl("Approval Sta

FireFox File Upload error


Hi to all ,

this is srinivas,

i have been trying for uploading a file . it works fine in INTERNET EXPLORER  not in FIREFOX.

firefox browser fileupload control takes only file name ,not entire path. so ERROR  is file not found error thrown at run time.

(i dont want answers which suggests me to do SAVEAS file in local disk then upload.)

please post another answers.

  hope u all understand my question .

thanks in advance.

Code write file asp.net 2.0 is working in firefox but IE not working.

If Not IsDBNull(ext) Then                                        ext = LCase(ext)                                    End If                                    Select Case ext                                        'Case ".htm", ".html"                                        '    type = "text/HTML"                   


I have a requirement that a user can upload as many files as he wish. So i am dynamically generating <input type="file"... and embedding them into form tag, Once user clicks submit button. I see that nothing is uploaded to aspx page. The post data looks like this   -----------------------------19718198955447 Content-Disposition: form-data; name=""; filename="" Content-Type: application/octet-stream You can see that the filename is blank and file content is not posted.   I have set the enctype of my form to 'multipart/form-data', but still the problem persists.   Can someone tell me whats the issue here?    suneeelid2000@gmail.co

Uploading Large File (40mb) fails... (webhttpbinding) (Azure)

I'm using javascript to upload a file to my WCF service hosted on Azure.  (40 mb file) Here is the snippets from the web.config for the service: <system.serviceModel> <bindings> <webHttpBinding> <binding transferMode="Streamed" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" openTimeout="00:25:00" closeTimeout="00:25:00" sendTimeout="00:25:00" receiveTimeout="00:25:00" name="WebConfiguration"> </binding> </webHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="RestfulEndpointBehavior"> <webHttp/> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="CPUploadServiceBehavior"> <serviceMetadata httpGetEnabled="true" httpGetUrl=""/> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <services> <service name="CPUpload" behaviorConfiguration="CPUploadServiceBehavior"> <endpoint add

Error In Firefox When uploading a file

The page isn't redirecting properlyFirefox has detected that the server is redirecting the request for this address in a way that will never complete.    *   This problem can sometimes be caused by disabling or refusing to accept          cookies.

Opening a PowerPoint presentation fails with error "invalid path or file name".

When you go to a Document Library and try to open the presentation, PowerPoint opens, but then you get the error "The path or file name for "file URL" is invalid.  Please check that the path and file name are correct."I installed MOSS/WSS SP2 about 2 weeks ago, this happened once or twice before then, but I now know of about a half-dozen presentations that won't open.There is a way to get the file to open, if you hit the drop-down next to the file and select Send To and Download a Copy, you can save or open it from there.If you try browsing to if from within PowerPoint, it won't open either, and will also not open in Explorer View.  We have replaced the file, saved as a different name, etc. with no luck.Using both IE 7 and IE 8 and both XP Pro and Vista Business workstations.Any ideas out there?Thanks,Rusty

VS2008 fails to create TLB file during compilation

I have a COM visible library originally created in VS2005. When I compile this project in VS2008 it creates a tlb file automatically. Now I've created a new COM visible library in VS2008 and I've set the ComVisible attributes and guids in the same way as the other project but when I compile it I get 2 warnings '... does not contain any types that can be unregistered for COM interop' and '... does not contain any types that can be registered for COM interop'. I don't know why this is happening has anyone got any ideas?

On Change:Prevent Evaluation fails with error Could not load file or assembly 'Microsoft.SqlServer.


Hi All,

I am facing a strange issue with Policy Based Management. Exact problem is as below

SQL Setups


I have Lenovo laptop having 3 SQL instances installed on it.

SQL Server 2005 (x86) Developer Edition 9.00.4053  -- Named Instance : SQL2K5

SQL Server 2008 (x86) Developer Edition 10.0.1600.22 -- Named Instance : SQL2K8

SQL Server 2008 R2 (x86) Developer Edition 10.50.1600.1 -- Named Instance : SQL2K8R2


I configured SQL2K8R2 instance as a Centralized Server and registed SQL2K8 & SQL2K5 under this. I configured a new condition by using facet: MULTIPART NAME. As per this condition Table Should start with TEST_ in database TEST . Evaluation Mode set to              On Change: Prevent. Idea is if some one logs to database TEST and tries to create table with name other then starting with TEST_ then it should fail.

I Imported this policy on registered servers thru Centralized Management Server Action, as expected policy got configured on Registred SQL2K8 instance

VWD 2010: Copy Web Fails if File Exists on Remote Site



I just started using VWD 2010 and I used Copy Web to upload the site to the server. However, whenever I try to upload a new version of a file that I've already uploaded, the upload fails, with this error in the log (as an example):

Copy from 'C:\Users\Lou\Documents\Visual Studio 2010\WebSites\genusus10\tools' to '' started at 10/6/2010 4:00:33 PM.
            Copy file password.aspx.vb from source to remote Web site.
            Has error -- Unable to add 'tools/password.aspx.vb' to the Web site.  The file tools/password.aspx.vb has been modified by (unknown) on 06 Oct 2010 11:45:33 -0500.

Copy from 'C:\Users\Gen\Documents\Visual Studio 2010\WebSit

ForEach Loop reads next file when child task fails


We have a ForEach loop that reads over a list of files in a directory.  We are placing the current file name into a parent variable and passing it into children packages through the Parent Package Variables configuration.  We have attached a Execute Package task for the ForEach loop Failure constraint.  The package is an exception handler that moves the current file (set in the ForEach loop variable mapping) to a failure folder.

The issue is that when the exception handler is called, the file name being passed in is the next file in the directory, not the file currently being processed.  Is this due to read ahead by the ForEach loop?  I pass this variable exactly the same way to child packages within the ForEach loop and it works fine.  It is just when I pass the variable to the constraint path from the ForEach loop that changes the value of the variable.  Is this because the exception handler sits outside of the loop container?

Thanks for your help.


Firefox ask save file aspx intermittent


I have a project in asp.net 4.0 IIS Win 2003 Server.
It's working perfectly, but after a while, certain pages are asking to save, instead of open.
Ai closing the browser and open the system again, with this back to work, but it's the same problem after a while accessing.

Why is this happening?

Setup doesn't show installation log file content when installation fails


I just tried to install SharePoint Server 2010.

The installation finally failed after applying all the updates, stating that installing SharePoint Server 2010 could not be completed due to some Office prerequisite not working alright.

The conclusion sentence proposed me to read the installation log files to get further details on the problem.

The only other thing available from the installation window there was the [OK] button - nothing more.

How am I supposed to read installation log files if there is not even a link available pointing me to those log files?

I'm currently performing a search operation on the whole C:\ drive to find the folder where the setup log files might reside.

Perhaps someone can tell me (and others if they are facing the same problem at installation) where the SharePoint Server 2010 installer puts these log files?



PS: I strongly suggest to add a Hyperlink control to the error message, pointing to the installation log files so that the user can quickly put his hands on finding a solution to the problem.

(A problem, I should add, that I believe could have been known to the installation script *before* it started wasting time on trying to install SharePoint Server 2010.)

How to set Handler mapping to redirect .php file to .aspx file on IIS7


Our website used to be  a php website, now everything changed to .net, but the customer still want to keep the original php Request url.  I want to know How to set Handler mapping on IIS7 to redirect .php file to .aspx file ? In more details,  when you click handler mappings on IIS 7.0, what kind of hanlder should you  add (add managed handler or add script map or add wild card script map or add module mapping) to redirect .php file to .aspx file? Thanks.



Windows 2003 R2 Enterprise Clustered File Server intermittently fails with "The specified network na

I'm not sure if this is the correct place to post this issue.   I'm hoping someone can help, we have been trying to solve this issue for months.

I am trying to solve a persistent IO problem when checking to see if a directory exists on a Windows 2003 R2 Enterprise Edition Clustered File Server (Active/Passive).  This issue is not limited to .NET code.  We are seeing it when we do a Directory.Exists, we get false, but the directory does exists.  When we go to create the directory, we get an error of "System.IO.IOException: The specified network name is no longer available."  If this failed all of the time, then we would know it was a permissions issue, but it is successful some of the time (even for days at a time, all with the same user trying to make the connection).  

The environment:

File Server  is Windows 2003 R2 Enterprise Edition Clustered (Active/Passive) sitting behind a firewall.

IIS servers 1/2 are Windows 2003 Standard Edition servers using an F5 BIG-IP for load balancing that sits behind the firewall and creates customer directories if they do not already exist (followed by writing data to the existing directory).  These servers also have WebMethods installed that write the data to the File Server.

IIS servers 3/4 are Windows 2003 Standard Edition servers using an F5 BIG-IP for load balancing that sits in the DMZ and a

Logshipping - Restore fails - missing .tuf file

I have had successful log shipping enabled on SQL 2005, SP3 on server A and B.  I had to remove secondary db to load localized reports, and when I try to re-enable or even reconfigure Log Shipping from scratch, the .tuf file is not being created in the backup and copy folders with the log files, therefore the trn files are skipped and cannot be applied.  I have completed similar steps on alternate SQL 2005 boxes  with SP3 Hot Fix 4 producing similar results.
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