Uploading an image to sql server

Posted on 2006-06-08
Last Modified: 2010-04-01
Hi, Im looking to upload a file into an sql server by posting my jsp to a servlet. Is there anywhere I can find what datatypes need to be setup in the DB and how I can them from the request in the servlet?

Im also looking to retrieve them as well so need some method of reconstructing the image when I get it back from the DB via another servlet.

Any advice?
Question by:Chriseybaby
    LVL 29

    Accepted Solution

    You'll need to store it as a BLOB.

    Insertion and retrieval is fairly simple, see here

    Author Comment

    Yes I can do it ok in mysql, but cant seem to find out how to do it in sql server. It has an image data typre, but not a blob, as far as I can see.
    LVL 8

    Assisted Solution

    In my past expereience, Ive never been able to get file uploads to work between SQL Server and non-microsoft languages. For example, Ive tried uploading from java to SQL server and couldnt get it to work, although I could get it no probs using ASP or .NET (we had several developers at oiur end try rthis seperatly and couldnt get it even close).

    I think MS have deliberatly made it hard to do - its a kind of lock-in to MS technology.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
    Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now