?
Solved

How to save base64 to Image in ms sql

Posted on 2013-11-29
2
Medium Priority
?
1,401 Views
Last Modified: 2013-12-02
Hi!

Have a base64-encodad string (i image file)

How do i save this to a image field in ms sql ?

Please give me example
0
Comment
Question by:team2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
lcohan earned 2000 total points
ID: 39686022
According to Microsoft research this will depend on the size of your image. If your images are < 256Kb, you should use VARBINARY(MAX). If they are above 1Mb, then you should use a FILESTREAM where the image is usually stored on the filesystem outside the database.

http://research.microsoft.com/apps/pubs/default.aspx?id=64525


Also please have a look at code sample from the link below:

http://rusanu.com/2010/12/28/download-and-upload-images-from-sql-server-with-asp-net-mvc/
0
 
LVL 2

Author Closing Comment

by:team2005
ID: 39689388
thanks
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question