Cashing on CDN hosts like Microsoft, Google etc., for referencing jQuery & similar libraries is good performance optimization solution particularly for rich interactive web applications . However, consider a worst case scenario where CDN network is down or somehow not accessible. You must plan a fallback for the scenario where CDN network, of course, would …
There’s no reason not to use a CDN service like such as Akamai, Amazon CloudFront or Windows Azure, especially when most of end-user response time is spent downloading static resources like images, css and scripts. Regardless of your CDN choice, once you have your assets in place you should mirror the same folder structure on …
Content Delivery Network (CDN) is network of geographically distributed multiple data centers with aim to serve end-user with higher availability and performance. Contents are served to end-user user from the nearest available data center. Apart from this, CDNs also offloads the traffic served directly from the content provider’s origin infrastructure, thereby providing other secondary but important …
This C# implementation can help you uploading a file through SFTP access.
C# solution to import & use a custom Font file while drawing/editing images.
Its very important to know your database stats while planning for some architectural update or database migration. The beforehand information would always add a plus to mitigate any risk and proactively take actions. Below is SQL Server script that provides information about database stats which include list of all tables, there respective record count, allocated …
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 …
Below is the ASP.NET C# implementation of Uploading binary data like images as POST request to target URL:
private bool UploadFile(string PostURL)
int contentLength = fileUpload.PostedFile.ContentLength;
byte data = new byte[contentLength];
fileUpload.PostedFile.InputStream.Read(data, 0, contentLength);
// Prepare web request...
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(PostURL);
webRequest.Method = "POST";
webRequest.ContentType = "multipart/form-data";
webRequest.ContentLength = data.Length;
using (Stream postStream = webRequest.GetRequestStream())
// Send the data.
postStream.Write(data, 0, data.Length);
catch (Exception ex)
//Log exception here...
The binary data so posted can be retrieved on target post URL using below code:
byte Image = ReadFully(Request.InputStream);
public static byte ReadFully(Stream input)
byte buffer = new byte[16 * 1024];
using (MemoryStream ms = new MemoryStream())
while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
ms.Write(buffer, 0, read);
This scenario is very handy specifically in establishing communication between two different web technologies. For example: You can POST image …
Synchronization of data from Production to Development environment is merely a task of taking backup of Production DB, restoring it to Development environment and running to cleanup scripts to hide/overwrite user-specific critical information. This is pretty straight forward and does not even require domain knowledge. However, reverse is tricky, risky & surely need good insight …
When your server is behind any proxies or load balancers, the remote IP@ gets masked. In such scenarios, the server variable “REMOTE_ADDR” may not provide the correct client IP@. The only way to get remote addresses is to check if the proxies rewrite the request headers which most of them does. You can look through …
The reason behind this question lies in HTTP protocol. Strange but it’s true. HTTP is a stateless protocol. Each request is serviced as it comes; after the request is processed, all of the data is discarded. No state is maintained across requests even from the same client. This would typically mean that all information associated …
Reviews are integral part of Software life cycle and must be done at each milestone during course of software development. More effective is the review process better would be the code quality & lesser would be the cost of development. In order to assist development team with key areas to be taken care of as …