IOT Virtual Conference - Register now to book your ticket and get updates
x
CONGRATULATIONS! C# Corner Q1, 2021 MVPs Announced
Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forumguidelines
Sidhartha Prusty
0
52
167
How to restrict user from uploading malicious file to the application
Aug 17 2020 2:48 AM
I have an ASP.NET MVC application where user can upload jpeg, png, gif, jpg files. How to restrict user to upload malicious files?
I am restricting the file upload on the basis of the file extension. However, If there is a malicious file '
filenam.html
' and the user tries to upload it by changing the file name to '
filename.html.png
', the application allows users to do so.
Please suggest how can I restrict the user from uploading malicious files from backend and frontend validation.
Note:
I can not restrict the filenames on basis of multiple dots present in it as a valid file name can contain 'filename V1.1.png'
Reply
Answers (
4
)
How to pass ascx.cs value to aspx.cs file
Div class aligning