Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.4 KiB

  1. <%@ LANGUAGE = PerlScript%>
  2. <html>
  3. <head>
  4. <meta name="GENERATOR" content="Tobias Martinsson">
  5. <title>ADO Binary Large Objects (BLOB)</title>
  6. </head>
  7. <body>
  8. <BODY BGCOLOR=#FFFFFF>
  9. <!--
  10. ActiveState PerlScript sample
  11. PerlScript: The coolest way to program custom web solutions.
  12. -->
  13. <!-- Masthead -->
  14. <TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
  15. <TR VALIGN=TOP ><TD WIDTH=400>
  16. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveState PerlScript" BORDER=0></A><P>
  17. </TD></TR></TABLE>
  18. <HR>
  19. <H3>ActiveX Data Objects (ADO) Reading BLOBs</H3>
  20. You can use GetChunk() of ADO to read Binary Large Objects; in contrast, AppendChunk() writes binary large objects.
  21. Below is a BLOB read directly from SQL Server's pubs database.
  22. <BR>
  23. <IMG SRC="readblob.asp">
  24. <BR>
  25. <BR>
  26. <%
  27. $url = $Request->ServerVariables('PATH_INFO')->item;
  28. $_ = $Request->ServerVariables('PATH_TRANSLATED')->item;
  29. s/[\/\\](\w*\.asp\Z)//m;
  30. $params = 'filename='."$1".'&URL='."$url";
  31. $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  32. $params2 = 'filename='."readblob.asp".'&URL='."$url";
  33. $params2 =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  34. %>
  35. <A HREF="index.htm"> Return </A>
  36. <A HREF="showsource.asp?<%=$params%>">
  37. <h4><i>view the source</i></h4></A>
  38. <A HREF="showsource.asp?<%=$params2%>">
  39. <h4><i>view the BLOB reading routine</i></h4></A>
  40. </BODY>
  41. </HTML>