c# - HTML textarea with image upload -


i'm in need of develop website allow user input information , images <textarea> save database. data displayed in page.

i though of using ajax upload file append <img> <textarea>. approach produce sql injection security threat.

so need advice on how achieve still can rid of sql injection.

when user uploads image, following , safe append image html textarea:

  1. is user upload valid jpg/gif/png/x image? (use image libraries verify that.)
  2. rename image "safe" crc32 of contents + current time in microseconds file name innocuous.
  3. put image new name in location can served.

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -