Page not found 404 error in IIS 7 when uploading big file size

I struggled with one issue for hours, before realizing that IIS7 was the culprit. Even though maxrequestlength was set to 1GB in httpclientrequest (web.config) and executiontimeout was set to 600 seconds, for a larger file it would keep failing. Firebug was throwing a “404 not found” error for the handler.ashx!

IS has a security feature called requestFiltering, which is to prevent denial of service attacks. It sets the file size to 30MB maximum by default.
To change it, add the following to youor system.webServer section of web.config


   <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2147480000"/>
      </requestFiltering>
</security>	     
             

Here maxAllowedContentLength is set to 2 GB approx.

How To: Delete a Team Project from your Team Foundation Service collection

To delete a team project from your Team Foundation Service collection you will need Visual Studio 2012 (or just Team Explorer 2012, which is free here). These provide you with the “tfsdeleteproject.exe” command line tool, which is usually located in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE. Open a Command Prompt in that folder and then run the delete command like this (don’t forget the “/DefaultCollection” bit and remember to use quotation marks around your team project name if it has spaces in it).

tfsdeleteproject.exe /force /collection:https://.VisualStudio.com/DefaultCollection “My project name with spaces”

The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020) – IIS 7 – Internet Information Service

In IIS7 I was trying to start my Default Web Site and was getting the following error screen.

IIS - Skype - Error_thumb[8]

A quick Google search turned up the following Microsoft Support Topic. Ok. Lets take a look at netstat and see what might be causing problems. Open a command prompt ([Windows Key + R] and enter cmd) and enter the command. After running netstat -ano, I noticed that there was indeed another process (with a process id of 796) accessing port 80. (You can enter netstat /? to see what the –ano flags are doing.)

netstat_thumb[12]

The offending process that is using port 80 has a process id of 796. Now, how to find out what that process 796 is?
Using the tasklist command will show a list of all processes running in windows. You can use the /fi flags to filter the results. In this case I’m using a filter that will only show processes with a PID that equals 796. tasklist /fi “PID eq 796”

Tasklist Filter Command_thumb[2]

The process with process id is Skype. Makes sense that it would be using port 80. I promptly closed down Skype and was then able to start my Default Web Site in IIS Manager. Hope this helps someone.

jQuery/Javascript to detect OS without a plugin?


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.7.1.min.js"></script>
    <script type="text/javascript">
        var os = navigator.platform;
        for (var i in navigator) {
            document.write(i + "=" + navigator[i] + '<br>');
        }

        var OSName = "Unknown OS";
        if (navigator.appVersion.indexOf("Win") != -1) OSName = "Windows";
        if (navigator.appVersion.indexOf("Mac") != -1) OSName = "MacOS";
        if (navigator.appVersion.indexOf("X11") != -1) OSName = "UNIX";
        if (navigator.appVersion.indexOf("Linux") != -1) OSName = "Linux";

        document.write('Your OS: ' + OSName);
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>

Setup Project in Visual Studio

Create a new project

  • Right click on Soultion Explorer of a Project.
  • Select New Project.
  • Select Project Type ‘Setup and Deployment’ under ‘Other Project Types’.
  • Enter project name in text box in front of Name:
  • Press OK

How do I change the Product Name, Author, Manufaturer, etc?
Select created a project from the Solution Explorer and Press F4. Properties list will appear where you change the Properties of Product like Author, Description of Product, Manufacturer, Product version, Product Name, Product Code etc.

How do I add readme/license form into Setup Wizard?
Select setup project from the solution Explorer and Right click on it. Select ‘View’ option from the context menu than after select ‘User Interface’. User Interface screen will in front of you. Now, right click on ‘Start’ and Select ‘Add Dialog’. A popup will shows up with some forms, from them select Read me form and press OK. Now, click on right Readme form and select ‘Properties Window’ and set Readme File path by selecting .rtf file from Application Folder. Keep in mind for doing this setup you have to create a .rtf document and add into the Application Folder under the File System of the Setup Project.

How do I add shortcuts of Product at User’s Desktop, User’s Program Menu, User’s Startup Folder?
Select setup project from the solution Explorer and Right click on it. Select ‘File System’ option from context menu.
Right Click on Application Folder and select Add->Project Out from the context menu. A popup window will appear, select main Project (source project) and select Primary Output. And press OK. Again right click on Application Folder and select ‘create shortcut. After that rename the Shortcut name and right click on it and select Properties window. Change the Icon property. Keep in mind you have to select the executable file from Application Folder. So the executable file ICON automatically set as Shortcuts Icon.

HttpResponse to String android

HttpClient httpclient;
	HttpPost httppost;
	HttpResponse response;
httppost = new HttpPost("website-url-goes-here");
try {
				response = httpclient.execute(httppost);
				HttpEntity entity1 = response.getEntity();
				InputStream is = entity1.getContent();
				
				String w1url = convertStreamToString(is);
				
				
			} catch (ClientProtocolException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			} catch (IOException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}

Add function into a class

private static String convertStreamToString(InputStream is) {

	    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
	    StringBuilder sb = new StringBuilder();

	    String line = null;
	    try {
	        while ((line = reader.readLine()) != null) {
	            sb.append((line + "\n"));
	        }
	    } catch (IOException e) {
	        e.printStackTrace();
	    } finally {
	        try {
	            is.close();
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	    }
	    return sb.toString();
	}

Last Page is Blank in Crystal Report

When you check the checkbox New Page After, you will see an icon just right to it. This icon represents Formula Workshop. Click this icon and type NOT OnLastRecord.

Save and close the window, you are good to test this and praise me for the rest of your lives 🙂

SMS India Android App

SMS India Android App

SMS India is an Android Application by which you can send SMS to anybody all over India free by way2sms, 160by2 and ultoo service.

SMS India is not an official app of any above service.

You need to GPRS (Internet) connection to send SMS.

If you have an account of any from above service, download app and start using their services right from your phone else create account from website.