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 …
Software life cycle is a relies on systematic solution specification, design, development, and implementation subject to continuous review and approval processes. Review process starts, right from the beginning, with the Requirements Document reviewed by the entire team and once the feedback/comments are finalised, the Requirement Document is freezed. Then comes the turn of the Technical …
Marketing involves everything from identifying customer needs (through research), creating products to meet those needs and making sure they are aware its available. Marketing introduces your products and services to your potential customers and target market. Thus, plays an important factor in the success of a business. Traditional offline marketing majorly focussed on Tri-Media (Print Ads, Television & …
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 …