Inserting Binary Files.
How can I insert a binary file into a SQL Server db using asp? It must be possible cause SQL Server has a datatype called "varbinary".
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Binary Files
I have many office files saved in sql server. The system sends them by one web page: RequestFile.asp. So every file has the same name requestFile.asp. How can i change requested URL on the server from www.domain.com/requestFile.asp to www.domain.com/someFileName.doc???? I am able to rise "Save or open downloaded file" dialog
Streaming Binary Files
I am working on an app that needs to stream binary files(such as PDF or WORD docs) to the browser. I cannot just pass a URL pointing to the file directly. I've tried the following in an ASP file: Code: Response.ContentType = "application/doc" Response.BinaryWrite strData where strData contains the binary data content of the WORD file in a string variable (for PDF, I would set the content type to "application/pdf"). However, the browser displays the data itself, rather than hosting the doc in the appropriate browser applet.
ServerXMLHTTP Failing With Large Binary Files
I am trying to use ServerXMLHTTP in an ASP page to return a binary file download to the browser. It works just fine with small files ( under 1 MB) but seems to fail with large files (4 MB, 11 MB in tests). A success would be that the browser kicks off the "Save As" file dialog. The failures are not always the same. Sometimes the browser tries to download the ASP file itself. Sometimes the the file seems to download successfully, but for example only 1.6 MB of a 4 MB file are actually downloaded and it doesn't seem to be a simple truncation. Sometimes I get "internal server error 500". Below is my ASP code. "Project1.exe" is small enough to be successful. If you substitute "OmniViewProSetup.exe" (4 MBs) it will fail.....
Load Binary Files Directly Onto Page
I currently have my database set up so that when a user uploads a file, it writes it in binary in the database. I know the benefits of having a separate file server and storing the path, but unfortunately, I can not do it that way. I know how to include the file in, lets say, a hyperlink so that any user can click on the file to view it. But, I would like to know how to include the file (mainly pictures) directly into the page as an <img src> Any suggestions? P.S. Once the information is in the database, these are the commands I use to output the file to a hyperlink. The file that this code is in is "file.asp?Id=" Where the Id is taken from the URL and used to obtain the correct file. I left out all the connection/cmd strings intentionally just show I could show the relevant information: Response.AddHeader "Content-Disposition", "filename=" & _ rs("FileName") Response.ContentType = rs("ContentType") Response.BinaryWrite RS("FileData")
Inserting/Displaying BLOB Files
How would a guy go about inserting BLOB files into an Oracle database? My company wants me to put logos in a database, and then depending on the client logging in, display a certain image. My boss wants an interface to allow for us to upload them to the database, also. I personally think just dropping them into a centralized directory and then storing the path, or the image name in a char or varchar field would make more sense, but. Can someone help me with this, or give me any ideas? I've floated the idea to him to buy a third-party component to facilitate the upload, but he's not really appreciative of that idea. What about .NET? From what I understand, it has very good file upload capabilities. I already have the framework installed on our server, so I should be able to use it if needed. Would that be a better route to go?
Binary Streaming
Here is a written descripton of my webpage. One frame split down the middle. The left side is the menu and the right displays what is selected from the menu. the user selects from the menu and on the right, clicks on "download image" link. the user is presented with a download dialog box. The user saves the image and when it is completed goes and selects another item from the menu. But this time nothing happens. It is like i have to refresh the page before anything works again. It is like it is stuck on the ASP binary stream file that forced the download. on my link i have <a href="donwload.asp" target="right">download image</a> How can i fix this?
Using Binary Write
I am having trouble trying to output an image using Binary.Write. I have a page which displays a record. One of the fields is an image and I want to display this on the page. My question is this: Is it possible to use the Binary write command i.e. Binary.Write("MyDatabaseField") on the same page that I want the image displayed on? If not Is there a way to nest it inside an image tag as follows: Response.Write("<img src=" & binaryWrite("mydatabasefield" & ">")
Binary Bit Masks
I'm working on a client project where i'm importing some data from a programme to a sql database.One of my fields contains a value which is created by bit flags Within this value are 10 bit flags, and i need to find out the value of each flag. An example of one of the bit flags is 0x0001 I'm guessing that it is to do with Binary and I need to apply a bit masks, but that's where my expertise ends.
Converting To Binary
I am using XMLhttp and responsebody to receive info from a webpage I dont use responsetext since i need the international chars هنِ The information I recieve is binary is there any fast way to convert the binary data to text ? I used this function but its slow compared to response.binarywrite and i need the information in a string so I can alter it with my script. So is there any way to convert Binary to Text just as fast as response.binarywrite ? Function BinaryToString(Binary) Dim I, S For I = 1 To LenB(Binary) S = S & Chr(AscB(MidB(Binary, I, 1 Next BinaryToString =
Binary File IO
What I would like to do is load a file's contents from a file on the server and put the contents. into a record in a database. For this I need to load the contents in binary format into a variable. Anywhere I looked, I've only found text I/O in ASP. (FileSystemObject and TextStream). How can I load any kinds of file into a byte array? Or is it enough to load it as a text stream and then treat the loaded string as a byte array?
Binary Write
I'm having problems with a simple binary write. The page is just supposed to write a JPEG back to the browser but the image does not display (the "X" image shows). Any help is appreciated. Here's the full code: <%@LANGUAGE="VBSCRIPT"%> <% Response.Expires = 0 Response.Buffer = TRUE Response.Clear Response.ContentType = "image/jpeg" set fso = Server.CreateObject("Scripting.FileSystemObject") set fl = fso.GetFile("c:afterWF.jpg") Response.BinaryWrite fl %>
ASP Binary Data Transformation
I'm using ADODB.Stream to open a binary file on the server and write it down to the browser using Response.BinaryWrite. It's working fine, but i need to make some changes to the binary data before it is send to the browser. I'm trying to use REPLACE, but it's not finding a string that i know it's in the binary file. Using InstrB i've found that the search inside the binary data is being done in a Unicode format, but i don't know how to make an ascii search&replace operation on binary data.
Convert Binary To Octal
i have searched and can't seem to find how to do this here it will ask the user to enter in a sequence of binary numbers that are separated by a period. For an IP there are 4 sets of 8 numbers that are separated by a period; 32 numbers, 3 periods. Once the user entered 0 and 1 i have to somehow convert that to octal and display the result on a new page with the octal answer.
Binary File Streaming
I have an exe file on a server that reads an XML file ( as a parameter) and generates a new file for downloading. However, most servers won't allow an exe file to create the new binary file. Is there any way that I can execute the exe file and have it download straight to the client instead of saving to the server?
Send PDF As Binary To The Browser?
I need to perform a task where I read PDF file on the server and send it to the client without using Redirect. The problem is that As far as I have read ASP and VBscript does not have a support for reading binary files so I need to use external dll developed in VB but the hosting company does not Let me register the dll. I there any other way to send pdf file to the client???
Binary Output Retrieved From Db
I'm attempting to read data written to a MySQL database and view it in the browser. I've searched the net for over 3 days and I've seen many posts that say it works great, but it's not working for me. The only thing that displays properly is a text file. Everything else is garbled. I desire to store & read PDF files though. Here's my code: <%@ Language = VBSCRIPT %> <% Option Explicit %> <!-- #include file="dbConn.asp" --> <!--#include file="adovbs.inc"--> ...
Trying To Write To A Binary File
When I run an asp script, I can view the contents on the screen in pdf format. But instead of displaying the information to the screen, I want to be able to save the same information into a binary file with a pdf extension. Does anybody know how to do that? I have listed the coded that writes it to the screen, but now want to be able to write the information into a file ....
Copy Binary Field
I use AspUpload to save files in a MSSQL database, orks just fine.Now I need to copy this binary from one table to another. DataType is image. I found the answer:in MSSQL ntext, text and image datatypes of large values have to be handled by Transact-SQL fuctions handling data block by block.(the field itself has only a pointer to the data).
Saving Binary Data
Does anyone know a website with a guide on how to upload binary data to a MySQL database using ASP?I have a script that i spent a lot of hours on getting to work,but after i upgraded my MySQL server it doesn't work anymore I'm just getting an error from the odbc driver(upgraded from 2.5X odbc driver to 3.51X): Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Invalid string or buffer length I'm trying to do the upload via AspSmartUpload,with a script that opens the record and uses .AddNew to the recordset.
Uploading Binary Data
How is it possible to upload binary data (like images or MIDI files) to the server? the code to (if necessary) a password protected FTP account?
Send Binary To Email
I have a problem converting binary to text. I am reading a page using xmlhttp xmlhttp.open "GET", url, false ,"userName","password" xmlhttp.send "" tex3 = xmlhttp.responseBody now I have the binary data of the html page I am reading. I can write this data to the asp page using Response.BinaryWrite tex3. I need to convert it to ASCI. I have tried: tex3 = BinaryToText( tex3) but did not work.
Reading Binary Data In SQL
I am storing PDFs as Binary data in MS SQL but do not know how to open the PDF files in ASP. Seperately, how do I capture the filename when I do a multipart/form-data?
Read Binary Data
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")
Read Binary File As Hex
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?
String Or Binary Data Would Be Truncated
i have the following update statment that this error is coming from i dont realy understand why it is thorwing the error up becuase when i was testing it i change the letter 'c' to and 'a' so not sure why it would need truncated. what does this error actual mean or what do i look for Code:
Sending Binary File (PDF) Over SSL Using ASP Script
i have an ASP (iis v5.0) application that generates a pdf file and this file is saved to the server. it is saved in a location not available to web users. i have an asp script (below) that sends the pdf file to the user as a binary stream. So that the user specifies which file to upload, the script performs some security checking and if it passes, it sends the pdf document. This works great in HTTP, but i want to do this using SSL. When i try the same thing over SSL, it gives me a 'File Download' dialog box with Open, Save, Cancel, More Info. The file name is the name of my script and file type is 'Adobe Acrobat Control for ActiveX'. When i click Save or Open i get an error message: Internet Explorer cannot download [scriptname] IE was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. The key to all this is that the report can change and i need to make sure the data doesn't get cached along the way. Hence there are a bunch of header manipulation commands included in the send function. Code:
Binary Access Read/Write In ASP
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...
Write Data To Binary File
I have one EXE file that customer need to download from my website. But I have one text file of Max 250 bytes of text in in that I want to append to the END of the Binary EXE file and give that for download to user. How can I do that. Please suggest. I think we need to go for some BinaryWrite kind of procedure using ADO Stream.
Extreme Binary Datas In Session
Please someone tell what is maximum lenght of Session- [item {field} ]. I am working on extreme binary data and it holding Session Variables.I don't no how much length should i give to the session variable. Note: Binary data is nothing but a Image data: Code:
Failed To Read Binary Data.
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?
How To Insert Binary Data In An Sql String?
I'm using conn as ADODB.Connection object. when I write: conn.execute "insert into table (binarydata) values ('" & binarydatastringvariable & "')" it returns the error: Unclosed quotation mark before the character string '(here is some string given)'. How can I insert binary data to a ms sql server 2000 table without using adodb.recordset?
Implement Binary Tree Nodes
I need to find the total number of nodes in a binary tree structure, Also need the the leftside and right side separately.
Writing Binary Code To Text
I have been asked to store text files in a DB as an OLE Object, (don't ask why just what they wanted) Anyway, I have got the files going into the DB. But now I am stuck on how to retrieve the OLE object, convert it back to usable text, and dumping it into a variable, to use in my ASP code. I have googled response.binaryread, binarywrite, and other such keywords, but have come up with a blank of this particular problem, can anyone advise me on the correct approach to the above.
Convert Binary Read PHP Code To ASP
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"); }
Output Jpg Stored In Database As Long Binary To Asp: How?
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".
How To Send A Form With Binary Data To Another Server?
I'm trying to submit an image object, along with some other text fields to another web server from within an ASP page but am stuck on getting the image to be submitted with the form. In a bit more detail: 1. When this particular page is executed, I want the server to pull an image from a db (stored as a BLOB) along with a few other text fields. This part is easy and I have no problems with it. 2. I want to submit the image, along with the text fields to a second webserver which typically accepts its input from a form (ie, the second webserver usually has a webpage where a user enters some information into form and browse for a file. When clicking submit, the form fields along with the file are submitted to the second server). The reason for this is that I'm trying to migrate from one web based photo album to another which uses a data structure that is complicated and difficult to interface with, so I'm using the web based image upload functionality of the new album. Code:
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?
Displaying Image From Database Saves Files To Temporary Internet Files
I have a website that we display images we have saved into a SQL Server 2000 database as binary BLOB. This is on a Windows 2003 Server. Just recently (a week ago) this website began to save the images it is displaying on the website as ASP pages in the Temporary Internet Files > IE.Content > Folder. We have other websites where we use the exact same code and these do not save files on the server when they are displayed. Here is the code to display the image: Set rs = objConn.Execute( SQL ) Response.ContentType = "application/octet-stream" Response.BinaryWrite rs("Product_Image") SQL is the SQL String to get the image from database When I add this code: Response.ContentType = "image/jpeg" The images still display on the website, but now are saved in the Temporary Internet Files folder as JPG's.
Aspupload Response.Binary Retrieve Image Datatype
Found that the code offered by aspupload to retrieve image datatype needs to be altered to work with MS SQL whereas it works fine with MS Access. The following piece of code has the BinaryWrite executing prior to the ContentType request: <% ' AspUpload Code samples: filelist_download.asp ' Invoked by filelist.asp ' Copyright (c) 2001 Persits Software, Inc. ' http://www.persits.com ' The file must not contain any HTML tags, not even HTML comment tags <!-- ...--> ' Build ADO connection string Connect = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath(".aspupload.mdb") ' If you use SQL Server, the connecton string must look something like this: ' Connect = "Provider=SQLOLEDB;Server=MYSRV;Database=master;UID=sa;PWD=xxx" Set db = Server.CreateObject("ADODB.Connection") db.Open Connect SQL = "SELECT * FROM MYIMAGES where id = " & Request("id") Set rs = db.Execute( SQL ) If rs.EOF Then Response.End ' Send actual file Response.BinaryWrite rs("image_blob") Response.ContentType = "application/octet-stream" ' Let the browser know the file name Response.AddHeader "Content-Disposition", "attachment;filename=" & Trim(rs("filename")) ' Let the browser know the file size Response.AddHeader "Content-Length", CStr(rs("filesize")) %>
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?
POSTing A Binary File Using Multipart/form-data
I'm trying to setup an ASP page to POST an image across to another page- essentially simulating what a browser does when you use <input type=file> in a HTML form. I'm able to correctly setup the headers etc and do the POST, but I'm unable to include the binary data of the image. The only way i've been able to do it is if I base64 encode the image. I'm using MSXML2.ServerXMLHTTP to do the POST, and I can't seem to do the .send with a form body that includes the binary data of the image. Code:
Creating A Single Binary Log In A IIS Server Containing Multiple Websites
I am working with IIS 5.0 and would like use the property CentralBinaryLoggingEnabled which if set true will create one single binary log file in place of a separate log file for multiple websites. This property is available in IIS 6.0. I would like to know if there is a patch available for IIS 5.0 which will create this property in IIS 5.0.
JPG Stored As Long Binary In Database: How To Write Output As Image In Asp?
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".....
ADO Streams And Binary Data Held In A MySQL Database Blob Field
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.
Convert ASP Files To Executable Files
I have installed PWS in windows 98 in each of the system at various places and put my Sales program files in the WWWROOT directory in all the branches. I'm afraid that the users may tamper my ASP files. Is there any way of converting .ASP files to .exe files so that the dont see my program.
|