Binary image and upload form help

. I have a form which upload a binary image and the description of that image into a Microsoft database.

I want to show the user what he had uploaded in a second page using a resquest.querystring. But it doesn't show anything. I have tried to change to Request.form but there is an error:

Error Type:
Request object, ASP 0206 (0x80004005)
Cannot call BinaryRead after using Request.Form collection

What am i suppose to do i cannot put request.querystring cuz it doesn't show and i cannot use request.form cuz i am using binaryread.

Posted On: Friday 26th of October 2012 02:46:11 AM Total Views:  389
View Complete with Replies

Related Messages:

Uploading binary data to a mysql database.   (229 Views)
, I've changed one of my sites from an Access database to MySQL. Seem to have everything fixed on the site apart from one thing. I have one page which uploads images into a database that is giving me some problems. Here is what i am doing to save the image: Code: File.SaveToDatabase rs("photo_filedata") rs.Update SaveToDatabase looks like this: Code: Public Sub SaveToDatabase(ByRef oField) If LenB(FileData) = 0 Then Exit Sub If IsObject(oField) Then oField.AppendChunk FileData End If End Sub And the error i get on the rs.Update line: Query-based update failed because the row to update could not be found. I didn't write the class for uploading the file, I got it from a script I found on (a few years ago) and just used it in my own site. Works nicely with Access. As far as I can tell from google there's a bug with the mysql odbc driver which causes this to mess up. If that is the case does anyone know a workaround for this
How to insert binary data in an sql string?   (210 Views)
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
Passing binary data to a dll   (236 Views)
, I have an asp page that uploads binary files. I am trying to pass the binary data to a function in a dll (written in c++) to process it. The file I'm testing with is the range of bytes from 0x00 to 0x51. When the data is passed to the function, it is passing it as the string "A^ ", which is what is printed out when I do a Response.Write. How can I pass the binary data to the function A Response.BinaryWrite prints out the correct contents of the file. Why won't it pass it as binary
Simple question w/ binary, please help!   (343 Views)
I've never used ASP before, but I have to becuase I can't do this in CF. I'm trying to take data from a database query, and display it in binary. I've been playing around with Response.BinaryWrite and StringToBinary(), and others, but I can't get it to display properly. For example, I want to display the timestamp "5/26/2004 13:30" in binary in an HTTP response.
response.binarywrite   (163 Views)
i have chosen to load some word files into a sql server database much to many users chagrin i am sure, but none the less, this is the route we have chosen to take. i have used an asp page so the user can upload a file to the database, there is also a page that lists all the files in the databse. in addition i also have a page that is supposed to display the file, however i run into an error on this page. this is the last bit of my code: If Not rs.EOF Then Response.ContentType = rs("Content Type") Response.BinaryWrite rs("File Data") End If i get an error message that reads: Response object error 'ASP 0106 : 80004005' Type Mismatch /TaskMan/test/file.asp, line 33 An unhandled data type was encountered. line 33 is the binarywrite line. does anyone have any experience dealing with this type of situation or any suggestion as to how to remedy the problem
Problem with downloading Zip file as binary file   (201 Views)
I use the following code in an page to download file from my site to the user: Response.Buffer = True Response.Clear() Response.ContentType = "application/octet-stream" Response.AddHeader("Content-Disposition", "attachment; filename=""" & dsDocFile.Tables("tbl_DocFile").Rows.Find(FileID).Item("FileName") & """") Response.Flush() Response.WriteFile(sFileName) This works with most every file type I've run across (jpg, gif, doc, ppt, xls, etc..). Normally when the user tries to access a file, a download window pops up asking the user whether he/she wants to open or save the file. However, when the file is a zip file, the user just receives a blank screen instead of the usual download window. Has any one run into this problem If yes, how did you resolve it Forgive me if this problem has been posted before. I am new to this forum.
problem downloading binary files using ADODB Stream   (285 Views)
hello, One of our clients websites allows users to register and then download software using the binary read (ADODB.Stream) object. This works fine in most places worldwide...however, in certain countries that have only slow dialup connections, many users are unable to complete the download before getting disconnected, etc. Then, when they reconnect, they are unable to pick up where they left off. Does anyone know of a better method of doing this using asp (or, or can point me in the right direction (articles or products) for a solution
Copy binary files with fileobject.copy   (362 Views)
Originally posted by : Josef (, it works fine to copy any file to any directory with the Fileobject.copy. I have though come across the problem ,that my .tar files created in UNIX are copied incorrectly. Is there a way to tell ASP/IIS that I want to copy the file as binaryCheersJosef
How do I write binary number to disk in ASP????????   (216 Views)
The program below should write out the do counter to disk. I doesn't. Instead I get the following message. Any help much appreciated. ADODB.Stream error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /BinaryData.asp, line 27
response.binarywrite cuts some of the image   (367 Views)
when I upload images to a db, everything seems to work smoothly. But when I'm trying to view the page, it seems that there is sth wrong with images - all of them are cut at the bottom. The image size is correct, the filesize is ok, but the bottom part of the image is blank... I use upload by Jacob Gilley which works OK. I've checked other formats - it turns out the gif and bmp work fine, jpg is cut and png isn't shown at all. And jpg is the one I need most...
File download from response.binarywrite without opening a new page   (416 Views)
See Binary Stream from Unicode String - ADODB.Stream arguments wrong for history.So now that I have my download-a-file code working, I have another question:After the user has made his selections for what file he wants (think of it as a report with criteria) I would like the file download to begin immediately upon clicking a button. I know how to launch a new page which, when I change the header type and flush the buffer vanishes and turns into a file download, but I'd like to skip the "new empty browser window" step if possible.Any ideas
Read and Display a pdf file from the server location as binary data   (255 Views)
Hi:I have a web-based application that uses ASP with SQL Server 2000 in the background. I have a field called weblink within a database table that list the names of pdf files (that includes the .pdf extension). These documents are stored on a network share drive.Using ASP code, I have hard-coded a portion of the path (beginning with \\servername\ISSA), that is everything up to the name of the pdf file. See the sample code below:do while not rs.eof counter=counter+1 weblink=trim(rs("doc_weblink") & "") if weblink"" then weblink="" & weblink & "" end ifI would like to read and display binary data in ASP. In other words, I would like to read and display the pdf file from the server location as binary data. I have some code that I started to use on an ASP page: Untitled Document------------------------------------ End of Code ----------------------------------------------Im just trying to get this to send binary data via ASP. When I run this code I get an Expected Statement error at the line of code, in the browser.Can anyone provide some very good code that helps me to read and display binary data, in this case a pdf file. Any one have some good code for writing a custom business object or component that adds the functionality (to read and display binary data in an IE browser). My primary objective is to send an existing Adode Acrobat (.pdf) document to the browser. I just want to get these (.pdf) files to the client. These documents are kept in a location other than the hierarchy underneath the web root.My stream is: \\servername\ISSA\ISSA Scanned\FX7054-01052-103 Final 5 Aug 02.pdfBut my problem is that I dont know how to incorporate it in the ASP code. Also, am I using the Response.BinaryWrite method to push the data back to the client correctly Please bear with me, as Im new to this concept of reading and displaying binary data
Comparing two binary files?   (227 Views)
I'm having trouble comparing 2 binary files, can anyone give me a pointer to what I'm doing wrong in the following function:CODEprivate function filesSame(FileName1, FileName2) Const adTypeBinary = 1 'Create Stream objects Dim BinaryStream1, BinaryStream2 Set BinaryStream1 = CreateObject("ADODB.Stream") Set BinaryStream2 = CreateObject("ADODB.Stream") 'Specify stream type - we want To get binary data. BinaryStream1.Type = adTypeBinary BinaryStream2.Type = adTypeBinary 'Open the stream BinaryStream1.Open BinaryStream2.Open 'Load the file data from disk To stream object BinaryStream1.LoadFromFile FileName1 BinaryStream2.LoadFromFile FileName2 'Open the stream And get binary data from the object BinaryFile1 = BinaryStream1.Read BinaryFile2 = BinaryStream2.Read if BinaryFile1 BinaryFile2 then filesSame = false else filesSame = true end ifend functio
how to display a binary-tree vertically?   (235 Views)
It's called Level-Order traversal. First google result.
returning a pointer to an element in a binary tree   (255 Views)
(Toggle Plain Text) struct node* rfind(struct node* current,int a) { if( current!=NULL && current->data !=a ) { current = rfind(current->leftchild,a); if(current == NULL) current = rfind(current->rightchild,a); } return current; } struct node *data = rfind(root,3); struct node* rfind(struct node* current,int a) { if( current!=NULL && current->data !=a ) { current = rfind(current->leftchild,a); if(current == NULL) current = rfind(current->rightchild,a); } return current; } struct node *data = rfind(root,3);
How to write image data to binary PGM file format(P5)?   (331 Views)
Hi all, I fail to write the image data to binary PGM format (P5). Let's say i have to write a image data into PGM P5 format. I have the information for width, height, Y_min, Y_max, XL, XR and the TEMPLATE1 (data matrix) ==>A region of interest from an image. Y_min & Y_max = minimum and maximum of the height value. XL & XR = min and max of the width value for the image. First, i call the subroutine, write_data_grey_binary(width1,height1,XL1,XR1,Y_min1,Y_max1,filename99[total],TEMPLATE1); (Toggle Plain Text) void write_data_grey_binary(width,height,XL,XR,Y_min,Y_max,filename,output) int width,height,XL,XR,Y_min,Y_max; char *filename; unsigned char** output; { int i,j,nread; FILE *fp; unsigned char* temp; if((fp = fopen(filename,"w")) == NULL){ printf("File 333 output data can not open\n"); exit(1); } fprintf(fp,"P5\n%d %d\n%d\n",width,height,(GRYSCL-1)); temp = (unsigned char*)calloc(height*width, sizeof(unsigned char)); for(i=Y_min;i
Writing a JPG file based on binary data   (309 Views)
Hi - What I'm trying to do: I am working with a Flash ActionScript programmer. In his application, he is sending a "ByteArray" (binary data that defines the JPG) of a JPG file to my ASP. In my ASP I want to receive that querystring and write the JPG file to the server. Possible How
Shadow upload error using request form, binary data message - Page 2   (312 Views)
cheers, glad I could help. there are already references to general help and to help insert into database, no point in adding another link. the part with use objUpload("name") intead of Request.Form("name") is explained in the main post.
String or binary data would be truncated   (288 Views)
i am new here. I am going nuts over this error. I know that string or binary data would be truncated means that there is a value that it's too long for its destination. The problem is that i save in a session variable the query before it gets called for debugging purposes, and i execute the same exact query on query analyzer and it works! I have reviewed every field and the values are OK. How can this be happening It doesn't make any sense. Is there any way i can tell the database to allow truncating anyway I am using sql server 2000, classic asp 3.0 I even inserted the same query from another asp page and it works ok. The users are using a page that inserts the data in a replicated server, but the tables have the same schema (since on the replicated server it was created from the replication) I don't know what to do.
Request.Form error after binary read   (198 Views)
, How can I prevent the following error from occuring I must use request.form to write to a database (I guess). ---- Request object error 'ASP 0207 : 80004005' Cannot use Request.Form /forms/wireless_comp1.asp, line 438 Cannot use Request.Form collection after calling BinaryRead. ----