Processing binary data

Source: Internet
Author: User
When we use a database, we sometimes use images or other binary data, and you have to use the GetChunk method to get binary objects from the table, and we can use AppendChunk to insert the data into the table. We usually come to fetch the data is this use! Getdata=rs ("FieldName") and the binary is so Size=rs ("FieldName"). Acturalsize getdata=rs ("FieldName"). GetChunk (size) We see it from above, We take binary data must first get its size, and then fix it, this seems to be the ASP in the processing of binary data, we are in the acquisition of all data from the client, is also used this method, hey, we can remember O. Let's take a look at how binary data is added to the database RS ("FieldName"). AppendChunk binarydata Hey, one step! In addition, use the GetChunk
and AppendChunk to take the data step-by-step out! Here is an example of fetching data! addsize=2 totalsize=rs ("FieldName"). Acturalsize offsize=0 do Where offsize binarydata=rs ("FieldName"). GetChunk ( offsize) Data=data&binarydata offsize=offsize+addsize Loop When this program is finished, data is what we take out. After the data is taken out, we will display it in the customer's browser! (This assumes that the figure is taken out) Response.contenttype= "Image/gif" response.binarywrite data hehe, is also very simple, however, I can hear a lot of netizens for
This is annoying! Believe it now know how to do it!?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.