Skip to main content
Post Closed as "Duplicate" by Panagiotis Kanavos c#
deleted 21 characters in body; edited title
Source Link
AbxS
  • 25
  • 9

How to check if the uploaded image file is brokenfake using ASP.NET C#?

I am using FileUpload control on my ASP.NET C# application, for purpose of uploading images file and I want to check if the uploaded image is broken or not.

My application checks the extensions and it works fine, but if I uploads broken image file or fake image file (such as txt file saved as image file) the server accept it.

My question in short is How to prevent that?

How to check if the uploaded image file is broken using ASP.NET C#?

I am using FileUpload control on my ASP.NET C# application, for purpose of uploading images file and I want to check if the uploaded image is broken or not.

My application checks the extensions and it works fine, but if I uploads broken image file or fake image file (such as txt file saved as image file) the server accept it.

My question in short is How to prevent that?

How to check if the uploaded image file is fake using ASP.NET C#?

I am using FileUpload control on my ASP.NET C# application, for purpose of uploading images file and I want to check if the uploaded image is broken or not.

My application checks the extensions and it works fine, but if I uploads fake image file (such as txt file saved as image file) the server accept it.

My question in short is How to prevent that?

Source Link
AbxS
  • 25
  • 9

How to check if the uploaded image file is broken using ASP.NET C#?

I am using FileUpload control on my ASP.NET C# application, for purpose of uploading images file and I want to check if the uploaded image is broken or not.

My application checks the extensions and it works fine, but if I uploads broken image file or fake image file (such as txt file saved as image file) the server accept it.

My question in short is How to prevent that?