How To Work With Byte Array In ASP?

I am getting byte array from COM to ASP page like this, This array is having DOCUMENT Image from Database.

set objData = CreateObject("MemoService.FileAttachement")

bRet = objData.GetAttachedDocument(strClipID)

Here, bRet contains byte array. When I try to open that document using

response.BinaryWrite bRet


I am not able to open the file in the browser. It is writing only the file name (for ex. c: emp.doc)

View Replies


ADVERTISEMENT

Convert Byte Array To String

I want to convert the binary data to string. I tried doing the same using following peace of code.

Function SimpleBinaryToString(Binary)
Dim I, S
For I = 1 To LenB(Binary)
S = S & Chr(AscB(MidB(Binary, I, 1)))
Next
SimpleBinaryToString = S
End Function

It works fine when the data is English. But when the binary data contains some Japanese characters the resultant string gets corrupted.

View Replies View Related

XMLHTTP Character Issue - Converting Byte Array To String

I'm using Msxml2.ServerXMLHTTP.3.0 to fetch a HTML page on a remote
server. The fetched page is then parsed and the information of interest
is extracted and send to the client browser.

However, the remote server does not specify any character coding in its
headers. If using ResponseText property in ServerXMLHTTP, some
international characters are not decoded correctly. This is due to
ResponseText assuming UTF-8 coding if no character set is specified.

My solution is to use the ResponseBody property which returns the web
page as an array of unsigned bytes. I then convert the data to a string
using the ADODB.Stream method as described here:
http://www.motobit.com/tips/detpg_binarytostring/

The string is then parsed and the required information is pulled out.

This solution works just fine but I wonder if there is some more
efficient (without the need for a byte to string converion) way to
solve the problem.

View Replies View Related

Image From Image Folder Into Byte Array?

I can convert an image that is retrieved from a FileUpload object into a byte array and insert it into the database..

When the user signs-up i wish tosimply insert into the Picture (DB Type = Image) field to an image i already have saved in my images folder?

Anyone know of a way to do this? Tutorials, articles or advise??!

View Replies View Related

IsArray Doesn't Work With Array Var Populated With Xxx.GetRows()

I'm using .getRows() with a local var array instead of doing a recursive
loop so that I'm being a good ASP newvbie and closing my object i/o's (the
recordset in this case) as quick as possible.

My problem is that I can't seem to use this to complete good effect because
the IsArray statement doesn't seem to work with a local var array that has
or has not been populated with the .getRows() property.

To explain, I used to do the following recursive loop (simplified to show a
concise example): Code:

View Replies View Related

'And'ing A Byte Value - How?

I get a TYPE MISMATCH complaint fm ASP when I do the following in
trying to extract the high-order four bits. The complaint being that the
strTemp value is a string. Well, yes - it's a 1-char string.

NumTemp = MidB(strTemp,1, 1) And &Hf0

What am I doing wrong? (Something dumb, I'm sure, but ... .)

View Replies View Related

Byte Explanation

I am now going a step further in asp trying to understand how asp browser upload scripts work. Looking at a couple of browser upload script, I unfortunatly constated that I really don't know nothing about "bytes". This is an obscure area to me. I consider bytes only a measure unit.

What are exactly bytes? If there is no way for visualizing them, then what can they be compared to? numeric values? any good article about this?

View Replies View Related

Display A Byte Arrya

I have a byte array containing the data of an image file (for example gif) in my asp code. How can I display it on the website? No image file exists on the disk. Is it possible to update a div field? What should I put there?
Please tell me there is another solution than writing the image to a file and then load it into the page, it's a real time application and speed is very important here.

View Replies View Related

Convert Byte To Numeric Value

I need access to the bits of a Byte expression and the logical functions operatge bit-wise on numeric vales - per the VBScript CHM.

So how do I convert a Byte to its numeric value?

View Replies View Related

Converting A Byte Value To Its Numeric Value

How do I do that? This is for some bit-diddling, but the logical functions like AND require numeric expressions, per the book.

View Replies View Related

ServerXMLHTTP And Double-byte Encoding

I am trying to use ServerXMLHTTP to post data containing Japanese
characters, but the data posts as question marks, boxes or just random ascii
characters. Here is the code I am using:

View Replies View Related

How To Save Byte Stream As Binary Document

A site Im working with has an API that allows one to retrieve files.
The file is a Word doc sent as a byte stream.

url="blah.asp?fileid=777777"
set oXMLHTTP=server.CreateObject("MSXML2.ServerXMLHTTP.4.0")
oXMLHTTP.open "POST",url,false
oXMLHTTP.send
binData=oXMLHTTP.responseText

I am trying to save the stream as a file on the Web server. It isn't
working. I've tried using FS.OpenTextFile, Stream.Write, etc.
Nothing is working.

Anyone have any sample code on how to do this?

View Replies View Related

Sending Double Byte Characters Via Jmail And Javascript

In dreamweaver using javascript I've developed a page that sends the form's contents via Jmail to the user. It works fine until i try to send double byte characters(i.e. japanese). It sends the email but once i open it up in a mail client the text is illegible. My mail server and mail client never has problems sending and recieving double byte characters, the only time this problem pops up is when i send an email from an ASP page via Jmail. I've tried sending the email in plain text and html but it hasn't made any difference. Here is the code I've been using: .....

View Replies View Related

Corrupted Double-byte Characters In Windows 2003 / IIS 6.0

I moved ASP WebPages from Windows 2000 server to Windows 2003 server platform. Those double-byte characters (Japanese) retrieved from SQL server 2000 are corrupted.

I am using Macromedia Dreamweaver MX as the development tool, by encoding webpage as "UTF-8" as the following, <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

I also add

<%
Response.CodePage = "65001"
Response.Charset="utf-8"
%>
into my ASP page. But it does not solve the problem.

My ASP pages are working perfectly in Windows 2000 server, but they are not working on Windows 2003 server (Web edition & Enterprise Edition).

Is there anyone encountered the similar problems before ? I research the Microsoft website, no any answers on that.

View Replies View Related

Winhttprequest Posting Byte() And String In Multipart Message.

I am near to desperation as I have a million things to get a solution
for my problem. I have to post a multipart message to a url that
consists of a xml file and an binary file (pdf). Seperately the
posting words fine but when I want to create one multipart message
with both then things go wrong.

The binary file is converted and of datatype byte()
The xml file is just a string.

I don't know how to merge these two into the multipart message. I have
tried converting the binary to string and then concatenate but that
doesn't work as it seems to leave off the last part of the file and
the boundary.

View Replies View Related

Rebuilding Of An Array From An Existing Array

I dump the entire recordset into an array:

If not rs.EOF Then
aEmp = rs.GetRows()

Contents of the array are in this order:

EmpID,EmpName,Indent,Sub_ID,Lft,Rgt,MgrID, LastName

This query sort on the basis of Lft and Rgt columns.

The name of the array is: aEmp.

My question here is how can I get only the LastName from the aEmp array into another array so that I can sort the names alphabetically and then display the employees in the alphabetical order.

Or is there is another way I could this by using the same array while keeping the lft and rgt sort of the query? If I sort based at the SQL query level, I can see the names sorted by the lft, rgt and lastname, but since the lastname is at the end of the sort list - it does not appear alphabetically.

View Replies View Related

Array Integers Vs Array Variables

In working with arrays, I have found that I am unable to dimension and array
with a variable that has an integer value but I can redimension one this
way. I haven't see any information that tells me if this is a requirement,
although it appears to be because I get an error if I try it.

Ex.

Dim b
b = 10
Dim a(b) ' this errors out but
Dim a() ' this
Redim a(b) ' works

Code:

View Replies View Related

Create A New Array From An Array

I want to create a new array called arrNames2 and copy contents of arrNames to arrNames2.

I then want to loop through my db and add more names (while going through the loop) to arrNames2. What is the best way to do this? Do I have to keep redim the array wehn I add more names?

View Replies View Related

Asp Does Not Work

i use a IIS 5.1 with win XP with the newest updates etc.
its possible to start aspx and html files but not asp files
what could it be ? what can i check ?

View Replies View Related

Can It Work Like A CGI?

Can a ASP work like a CGI.(Email Scripts) ? Can a ASP script for email will work, if a Script is on 1 server and form(html.form) is on another server and a thank you page is on 3rd server. Like if u don't know about a CGI there are many websites who give you permission to use their script by editing little bit in yours form and place them on yours server website, there are number of site.

And 1 more thing I want to ask is if some one use a windows server he have a form html on that server, can he run asp script which is on Linux server to get form result on his desired email id.

View Replies View Related

OnAfterPrint Cannot Work

cannot using onAfterPrint in IE 6.0, the page can print but cannot close.
Why??

my code like as below

<body
:
<script language="javascript" type="text/javascript">
<!--
window.print();
//-->
</script>
</body>

View Replies View Related

I Cannot Get This Inner Join To Work In Asp

<!--#Include Virtual="/bug/adovbs.inc"-->

<title>Bug Status Board</title>

<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog =
techsupportBT; User Id = sa; Password="
Set rs = server.CreateObject("ADODB.Recordset")
sSQL="SELECT T.BugIndex, T.[Date Entered], T.DESCRIPTION,"
sSQL= ssql &" T.Company, T.Technician, T.Developer, T.PROGRAM, "
sSQL= ssql &" T.Status, T.PRIORITY, T.[Version Fix], n.noc"
sSQL= ssql &"FROM TSHIGHISSUES INNER JOIN noc ON T.BugIndex =
n.bugindex "
set rs=conn.Execute(ssql)

and this is the error message that I get Error Type:

Microsoft OLE DB Provider for SQL Server (0x80040E14)
Incorrect syntax near the keyword 'INNER'

I cannot find an example anywhere that helps with this situation. This works fine in SQL, but for some reason asp is being a pain.

View Replies View Related

Can't Get CDO Mail To Work

I copied ASP/VBScript code from several sources and adapted it to my page and variables. Here is my current code for implementing CDO:

View Replies View Related

Why Sub Procedure Does Not Work

I am trying to construct a sub procedure that concects to db , executes a stored procedure and returns a recordset. Connection to db and executing the stored procedure works fine.

The problem is that when I call the sub in the asp page to be executed the recordset is refused to be returned from the sub and the recordset itself does not appear to be constructed. or in another words the error displayed is: 'object required' --> refering to my recordset --> 'rs'

I do not know why, can any one tell me the reason, I tried much but with no result.
NOTE: For testing puropses I looped through the recordset isnide the sub itself and it worked fine Code:

View Replies View Related

Global.asa How Does It Work?

Is there somebody who can explain to me how I can use a Global.asa to store Functions and Variables in it? I understand that there are 4 events that can be used in a global.asa : Application_OnStart, Application_OnEnd, Session_OnStart, Session_OnEnd

But still i don't get how i can CALL functions of variables. Because with those 4 things they start all in the beginning or in the end of a session or application.

For example i use an encrypt function in different pages, can i just put it in de global.asa and call it when i need it?

View Replies View Related

ASP Not Work In W2003

I've just moved all asp file from IIS4/5 to IIS6(2003), but they don't work.It there any trick?

View Replies View Related

Work Week

I need to provide a pulldown with work weeks displayed.Is there any easy way to do this?

I would like to go 6 months from the current date and show a week as Oct. 11- 15.Which is Monday to Friday.

View Replies View Related

Validation Does Not Work

I have an asp page. In this there is a form when submit it have to chech if the fields are not emtpy.When it not empty it wil insert into a database an a mail.If a field is empty it send it anyway, it doens't do the validation. Here is a part of my code:Code:

<% if request("action") = "Verzenden" then
datum = request("dtmmeldinghelp")
if datum <>"" then
'I have tried also: if len(datum) <0 then
response.Write("<html>" & "<body>" & "Fout" & "</body>" & "</html>")
else
' here come my sql insert to code and the code for email
' this works fine
%>

View Replies View Related

Aspfunction Does Not Work

i built this test program:

<HTML>
<HEAD><TITLE>Test</TITLE></HEAD>
<BODY>
the time is <% = Time %>
</BODY>
</HTML>


It does not show the time! very basic probably but not for me.

View Replies View Related

Button Won't Work

I am trying to add a button to a menu which it's action is conditioned by a session variable. The button shows up fine but I get no action from the button being clicked . The variable does have a valid value. If anyone can help me out with this it would be greatly appreciated. The code follows:

<input TYPE="submit" NAME="Button1" VALUE="Quote Generator">

<SCRIPT LANGUAGE="VBScript" FOR="Button1" EVENT="onClick">
If Session("RVQuoteAuthority") = "Y" then
Response.Redirect(Quote.asp)
else
MsgBox "No Authority"
End If
</SCRIPT>

View Replies View Related

How CDONTS Work ??

Talking about the cdonts objects.. i want to send the email in windows xp..
i downloaded cdonts.dll and registered it.. but still i am not able to send
the mail.. is it so that i need to set the settings in the Virtual SMTP server
in IIS ?

View Replies View Related

Does GetObject Work With ASP?

I have not been working with ASP for too long at this time and am not real familiar with a lot of things about ASP. I have searched for articles on the following question but
not come up with any definite answers. Code:

View Replies View Related

Setting Up IIs To Work With Asp

I am trying to get ASP to work with IIS and i keep getting page cannot be displayed when i try to open asp pages? Do i have some settings wrong somewhere?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved