I am making an intranet for company employees using ASP.NET and SQL Server, one on my profiles section Uploaded image area (image field to show image, input to select file, and load button), it's working fine, the image is loading in a folder, but I also have text fields where the user Adds information, it's also great Is doing and saving in the database, now what I want to do is that the user uploads the images, and ends with all the text areas when he clicks the submit button to send all the fields to the database name Or the path of the photo uploaded by it also goes to the database, all of my text files are being included with the SQLDataSource.
Any ideas how to do this ?? I like to do it with the front side code, because behind this code I only have SqlDataSource1.Insert ();
Do not save images on the disk, doing this will make an ugly mistake sooner or later The user should upload the image, resize / crop the image on the server, change the image to base 64, and save the base64 string in the varchar (max) column.
Because you save only small pictures (avatar), this solution should work without any problems. Also, when you get the base64 string back from DB, you can embed it directly into the HTML if IE 7 is not a requirement. Here's a list of browsers that support
if base64 Is not embedded in HTML, then bundle an ASP.NET page that decodes the base 64 string into the image and gives a binary response. Then use it in your page:
& lt; Img src = "http://www.example.com/images.aspx?thimageDBrowID=12345" width = "20" height = "20" />
Comments
Post a Comment