Read Binary Record From Database With ADODB.Stream
I wanna read binary data from database with ADODB.Stream object. So I wrote code..
---------
<%
query = "SELECT * FROM Categories"
adoDB.DefaultDatabase = "Northwind"
adoRs.Open query, adoDB, 1
Set rec = Server.CreateObject("ADODB.Record")
'read [Picture] column.
rec = adoRs(3)
------------
And the 'rec' TypeName() is 'Byte()'
But I can't get it to ADODB.Stream. How Can I do? Or Can I read binary column to another way?
View Replies
ADVERTISEMENT
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
After the latest security update, is it still possible to use adodb.stream
on the server side?
View Replies
View Related
We have an application, written in ASP, that uses the ADODB.Stream to be
able to open files and write byte arrays to the Response object. If one of
our administrators patches the web servers this application runs on in
Windows Update, I'm screwed, right? You've essentially just disabled this
COM object, for not only its evil purposes, but its useful ones?
View Replies
View Related
I am using ADODB.Stream for downloading the files on user machine. The code works fine when filesize is less than 10 MB. But if file size is more than 10 MB then it doesn;t get download. Can anyone tell what is the problem. I have to user some different component.
View Replies
View Related
I am trying to secure .pdf files by having users login and based on UserID, allow access to certaing .pdf's.
I have tried it a few different ways using different file types and their corresponding contenttype and nothing happens. I even used the same example from microsoft.com and I get "page cannot be displayed"....
View Replies
View Related
In Windows 2000 IIS 5 SP3 this:
http://support.microsoft.com/?scid=kb;en-us;276488
is not working. No error but wants to save binary.asp to disk and can't. I have it in a High Isolation Application.
View Replies
View Related
I'm trying to create a page that uploads a file. I get an error message saying ADODB object Stream is not available in my server. How do I upgrade my ADODB library?.
View Replies
View Related
I am using the code below to ensure that a download will be sent to the user as a save/open dialog box and not open up in the browser. However I get one of a few different issues.
1. Sometimes the when you click save the box just dissapears and you never get to choose where to save it. And then don't get the file!
2. If you get past the first problem (seems to be unique to pdf's) and can select where you want to save the file, it then doens't actually download the file and the box just dissapears again!
3. If you get past both of these, documents are often corrupt!
Any idea what could be causing these? The server has MDAC 2.8 installed, and it works slightly better on our local testing server Win2k than it does on the live Win2k server! All very odd! Code:
View Replies
View Related
I`m writing a little routine that captures the data from a form submit (ie a picture) and then at the back end the asp will saved it back out into a file on the server.
I can capture the file fine and display the binary data to the screen.. but now I`m trying to write the data back into a file on the server. After a bit of searching around on the net I found that most people where suggesting using the ADODB.Stream functions.
So this is what I've got but for some reason when I go to write the binary variable it complains. Code:
View Replies
View Related
I have an ASP page that downloads file with the ADODB.Stream object.
I've found that if the user click cancel in the "Save file as" window or
during the downloading, the download is no more available, the page hangs
over and and the session have to be closed. (In some cases you have to Cancel
more than one time the download process to rise up this error).
I've experienced this problem, as a user, with many major webmail services
too!
View Replies
View Related
I have an asp page that needs to display the string that is returned from a
cgi file.
As an example, if you enter http://mydomain.com/mycgi.cgi?98127398 in to a
browser, it will display YES or NO
I need to have my asp code query this url, get the resulting string, then
act upon it (basically use the answer to display a nice big tick or a big
cross). Code:
View Replies
View Related
When trying to load a file using ADODB.Stream, LoadFromFile method I get the following error:
Safety Settings on this computer prohibit accessing a data source on another computer
I'm running windows server 2003. I have the site security set to "Local Intranet"
Any Suggestions?
View Replies
View Related
I use the Stream method to serve certain file types to the user. If the
type is pdf, it opens in the browser fine. My problem is with those
that the browser doesn't have plug-ins such as ppt, word, etc. it
prompts to choose Open/Save/Cancel and defaults the filename to the ASP
page serving the content. ie. BinarySend.asp -> BinarySend.doc,
BinarySend.ppt.
If I use
Response.AddHeader "content-disposition", "attachment;filename=" &
sFileName then it defaults the filename to the name I specify but
always prompt a download instead of opening directly.
Is there another way to default the filename in situation like this?
View Replies
View Related
It involves using ASP/VbScript and ADODB.Stream to read binary data from a *.DOC or *.RTF
file and then send it to the user with Response.ContentType and BinaryWrite.
Everything works fine until I try to Replace() certain strings in the *.RTF
file with my own data. I'm assuming Replace() is choking on the binary characters, or
incorrectly thinking 0x00 values are marking end of string. Code:
View Replies
View Related
I use the code below to authorise the download of certain files.
Thus, instead of linking to the file in a wwwroot directory, I link to
this code with the filename as a parameter, and the script streams the
file if the user is authorised.
This has worked fine on PDFs, DOCs, XLS, etc. until today, and 18MB
file presents the error message 'format error: not a pdf or corrupt'.
Is there a file size limit, or a default that needs overridden? Any
thoughts? Code:
View Replies
View Related
Does anyone know of a "pure ASP" upload script that does not use the binary read? I am sure many people are looking for this as well..as you cannot use the binary and request.form in the same script. I am trying to integrate a file upload into an already built script using request.form.
View Replies
View Related
I write the code as follows. But I cannot print the binary data as meaningful data format. any idea?
Response.Buffer = True
Const adTypeBinary = 1
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = adTypeBinary
response.binarywrite rs("abc")
View Replies
View Related
I'm using ASP to generate an RTF (rich text) file, via the FSO. No problems with text, but when it comes to inserting images, the files have to be embedded as either binary or hex.
Try as I might, I can't get binary to work (Word b0rks trying to open the resulting file). When I create a simple RTF in Wordpad and then view its source, Wordpad seems to be embedding the image as hex. Does anyone have a suggestion as to how I could read an image file off the disk in hex format for writing into my RTF?
View Replies
View Related
Im writing a web interface for a CRM product which has the ability to store files within a database... Now, the problem is, these files are binary files, and VBScript doesn't have support for binary files (as far as i know...)...
To overcome this i wrote a component (ActiveX DLL) in VB6. This component works fine, but as soon as i use it in ASP, my computer beeps and then sits there looking like it's doing something forever...
View Replies
View Related
DXUpload.Form.1 Error '80020009'
Failed to read binary data.
/backoffice/album/album_save.asp, Line 29
___
If lJt = "GENERAL" OR lJt = "GOODS_DETAIL" Then
29: Set objUpload = Server.CreateObject("DXUpload.Form")
lAction = objUpload( "ACTION" )
Else
lAction = request( "ACTION" )
End If
___
here's my code... I can't see why this error occured...
any advice to sort it out?
View Replies
View Related
Can anyone help me convert the following php code to its asp equivalent? Code:
if(file_exists($file) && ($ext==".mp3"))
{
header("Content-Type: audio/mpeg3");
// open for binary read
$fh = fopen($file, "rb");
while (!feof($fh)) {
print (fread($fh, 10000));//filesize($file)));
}
fclose($fh);
}
else
{
print("ERORR: The file does not exist");
}
View Replies
View Related
I have am getting this error:
ADODB.Recordset error '800a0cb3'
Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype. Code:
View Replies
View Related
I am passing file through aspSmartUpload by using input file form control in my form. But I cannot use Request.Form("Variable") command in my called asp. And it says you cannot use it during or after binary read. I guess aspsmartupload my have resolution for its problem.
View Replies
View Related
is it possible to download binary files from database(sql).. ?
View Replies
View Related
For a while I am working with ThumbsPlus ( http://www.cerious.com/ ) as manager for pics.
The benefit of the program is that it stores all kind of information in a central Microsoft Database that easily can be manipulated. A thumbnail of the picture is also stored in de MDB as long binary (jpeg format)
I made a small script that extracts all kind of information of the MDB by use of queries and ASP. This works perfect for string/numerical information.
I am wondering if I can also write the stored (jpg)thumbnail to the asp file so that I have a preview of my picture.
Can this be done? What is the syntax?
I tried already :
Response.BinaryWrite BinData
Where BinData is the contents of the Thumbnail field. When I take a look at the MDB table in design view, the DataType of this field is "OLE object", if I open the table, the contents of the field displays "long binary data".
View Replies
View Related
I had made a form name 'dform.html' which asks idno, name and phone from the user and after the user clicks on button "save data" sdata.asp is executed. sdata.asp is written to save the values entered for idno,name and phone in dform.html into table "myfriends" in the mydata.mdb (access database). but when i am clicking on save data button i am getting error saying
"Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/SDATA.ASP, line 9"
can please anyone tell me why i am getting this error.
View Replies
View Related
For a while I am working with ThumbsPlus ( http://www.cerious.com/ ) as manager for pics.
The benefit of the program is that it stores all kind of information in a central Microsoft Database that easily can be manipulated. A thumbnail of the picture is also stored in de MDB as long binary (jpeg format)
I made a small script that extracts all kind of information of the MDB by use of queries and ASP. This works perfect for string/numerical information.
I am wondering if I can also write the stored (jpg)thumbnail to the asp file so that I have a preview of my picture.
Can this be done? What is the syntax?
I tried already:
Response.BinaryWrite BinData
Where BinData is the contents of the Thumbnail field. When I take a look at the MDB table in design view, the DataType of this field is "OLE object", if I open the table, the contents of the field displays "long binary data".....
View Replies
View Related
Error Type:
Microsoft JET Database Engine (0x80040E21)
Cannot update. Database or object is read-only.
/q_maker/aero_admin/delete.asp, line 12
what is wrong! i checked the db and its not readonly.
View Replies
View Related
Has anyone else found a memory leak using ADO streams to access binary data held in a database. I have searched through this forum and have not come across anyone else, so maybe it is just me.
The scenario is as follows:
Windows 2000 SP3
MDAC 2.7 SP1
IIS5
MySQL 3.23
MyODBC 2.50
If I query the database and do a response.binarywrite everything works fine and no memory leak. eg. response.binarywrite myrecordset("blobfield")
If I read the very same BLOB field into a ADOstream I then get a memory leak in DLLHOST.EXE of how big that binary field was. ie If the picture is 140k in size DLLHOST.EXE increases its memory size by 140k.
This keeps on happening until DLLHOST.EXE is something like 250 MBytes in size at which point it stops working. Quick restart of the IIS Web service and I get all my memory back.
The command I am using to get the data into the ADOstream is picturestream.write myrecordset("blobfield")
I have also tried putting the binary data into a variable first before inserting it into the stream:
set x=myrecordset("blobfield")
picturestream.write x
The stream is closed and set to nothing at the end of processing. Everything is cleanly shut down. Through testing I know the memory leak occurs once the data has been written into the stream. The stream is correctly created as type binary.
The stream problem I am encountering does not seem to be limited to ASP, I tried it using Visual Basic to create a COM component to do the same job and still got a memory leak.
So the questions are:
1. Has anyone come across this before or fixed it?
2. Is there another way of getting binary data out of MySQL, something like the opposite of LoadFile?
I have wasted so much time on this problem but cannot find, having searched Microsoft's knowledge base and the rest of the web, any reference to the problem.
View Replies
View Related
How do i connect to Oracle Database through ASP? I have Used the Following Syntax But it gives me ADODB .Connection error no as '800a0e7a' saying Provider Cannot be Found.
set objcn1=server.createobject("Adodb.connection")
objcn1.Open "Provider=OraOLEDB.Oracle;Data Source=servername;User Id=abc;Password=cbs"
OR
objcn1.Open "Provider=msdaora;Data Source=servername;User Id=abc;Password=cbs"
View Replies
View Related
i recently just uploaded an access database only to find that it has read only persmission, so any adding, updating, deleting etc.. doesn't work anymore. the file became read only when i uploaded it. How do i change the read/write access to this file online?
View Replies
View Related
Im just not sure how to go about it because im new to asp. I want to write an ASP script that will read a money amount from an SQL database and when money is taken through a payment it will change the value in the database.
View Replies
View Related