Get Absolute URL – Web Application

Getting fully qualified absolute path of ASP.NET application is always tricky and problem arises when code moves across various platform. Hard coding the Application Path is no where a good solution here. The URL syntax is:

Two solutions that you can look for in such scenarios: 1. Add an entry in your web.config file …

Upload Binary data as HTTP POST

Below is the ASP.NET C# implementation of Uploading binary data like images as POST request to target URL:

The binary data so posted can be retrieved on target post URL using below code:

This scenario is very handy specifically in establishing communication between two different web technologies. For example: You can POST image …

Detect Executable file or Virus during File Upload

Many times we fall in a situation where we have implemented detection of file type based on file extension. It’s pretty easy to do that on both client as well as server side. But does it guarantees that file uploaded is not actually an “exe” file. Well, anyone can rename an “abc.exe” to “abc.txt” and upload it to your …