Do you know how to insert an image with blob field in asp? I have a code but I have an error, can you help me?
9 5143
I've attached a Demo that I created awhile ago that demonstrates how to Edit a specific Graphic Image stored as A BLOB in an OLE Object Field. The original Code is from Alan Warren which I modified to suit a specific User's needs. It also clearly illustrates multiple aspects of BLOB Storage, including: writing a Graphic File as a BLOB to an OLE Object Field, how to read an Image stored as a BLOB, how to Edit a BLOB Image, etc. Most of the relevant Code is contained within the Code Module behind frmInventory. P.S. - You can also reference this Article that I wrote awhile ago. It generated a lot of interest with multiple Replies from very knowledgeable individuals. You should find it very interesting. http://bytes.com/topic/access/insigh...blob-not-movie
ADezii Will it serve me in sql?
I have this code is asp and it gives me error in the log file
- f Request.TotalBytes > 0 Then
-
req_bytes = Request.BinaryRead(tot_bytes)
-
'Parse POSTed request JSON
-
'Parse POSTed request JSON
-
reqArgsString = BytesToStr(req_bytes)
-
reqArgsArray = Split(reqArgsString, "&")
-
For i = 0 To UBound(reqArgsArray)
-
reqArgsArray(i) = Split(reqArgsArray(i), "=")
-
Next
-
-
'Decode base64 image from JSON POST to BytesArray'
-
'Decodificar la imagen base64 de JSON POST a Bytes Array'
-
base64Encoded = URLDecode(reqArgsArray(1)(1))
-
base64Decoded = decodeBase64(base64Encoded)
-
'Response.Write base64Decoded
-
'' GoTo Done
-
-
-
'DB Connection Object
-
'Set cn = Server.CreateObject("ADODB.Connection")
-
'ConnStr="DRIVER=SQL Server;SERVER=161.196.101.140;UID=sa;PWD=P@ssw0rdsql;Database=ContinuumDB"
-
'cn.Open ConnStr
-
'Dim strQry
-
'strQry = "INSERT INTO GA_BLOB (""Blob_Segment"", ""Blob_Person_ID"") VALUES (?, ?)"
-
-
' strQry = "INSERT INTO GA_BLOB (""Blob_Person_ID"", ""Blob_Image_ID"", ""Blob_Segment_No"", ""Blob_Format"", ""Blob_Segment"") VALUES (?, ?)"'
-
-
'"insert into GA_BLOB (Blob_Person_ID, Blob_Image_ID, Blob_Segment_No, Blob_Format, Blob_Segment) values ('" & Request.form("Blob_Person_ID") & "', '" 0 "','" 0 "','" 0 "', '" & Request.form("Blob_Segment") & "')"'
-
-
'Dim cm As ADODB.Command
-
'Set cm = New ADODB.Command
-
'cm.ActiveConnection = cn
-
'cm.CommandText = strQry
-
'cm.Parameters.Append cm.CreateParameter("@Blob_Segment", adVarBinary, adParamInput, 100, base64Decoded) 'Leave this parameter first
-
'cm.Parameters.Append cm.CreateParameter("@Blob_Person_ID", adInteger, adParamInput, , reqArgsArray(1)(1))
-
'cm.CommandType = adCmdText
-
'cm.Execute
NeoPa 32,556
Expert Mod 16PB
I've split this hijack question into a new thread in the ASP forum as that's explained as the language used.
@Douglas.
Please be more careful when posting your questions and never add one to an existing thread. Always use the [CODE] tags when including code.
@ADezii.
When you see a hijack of an old thread it's far better to report it than to respond to it. In this case I suspect the question is not only a hijack but also posted in a thread from entirely the wrong forum.
Alternatively feel free to PM me if you see any issue.
When you see a hijack of an old thread it's far better to report it than to respond to it. In this case I suspect the question is not only a hijack but also posted in a thread from entirely the wrong forum.
My apologies, missed both points (ASP + Hijack)! Wrongly focused in on the BLOB.
NeoPa 32,556
Expert Mod 16PB
Don't worry about it :-) I doubt Douglas realised what he was doing either. It's not always easy to start in a new environment and get things right first time.
These are just pointers to help.
A thousand apologies just comment seeing the possibility that some of you have the knowledge of what happens to me and could help me really apologize if I offended them I only look for a help to see if they know something of the code in which I am working.
NeoPa 32,556
Expert Mod 16PB
We understand Douglas. We assumed you were innocently asking for help. Sometimes it's difficult to notice some of the other details when you're focused on your own problems.
BTW The thread's been moved to the ASP area now for you. Hopefully you'll get some interest, but often experts will see a thread which already has answers and move on. Also, the Access area is certainly the busiest on the site so I'm not sure how busy this one is nowadays. Even though I'm an administrator of the site as a whole my work is mainly in Access, which I know keeps quite busy.
Best of luck.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Abhishek Bagga |
last post by:
I want to insert Image in the column headers of the Listview control
I have been trying this but was unable to achieve it.
Is it possible? if yes kindly guide me how to achieve this.
--
-...
|
by: linus |
last post by:
Anyone try insert image or binary files to MySQL using
ASP.NET?
Thanks a lot
|
by: Piedro |
last post by:
Hi group,
how do I read a image/blob field in cas option strict is on?
First I had it turned off and I read it like this:
Dim b() As Byte
If Not dsSupp.Tables(0).Rows(0).Item("BITMAP") Is...
|
by: guoqi zheng |
last post by:
dear sir,
I am using itextShap for pdf generation.
I know I can insert image into it, I can add header to it as well. However,
I can not add an image as a header.
Does any one has experience...
|
by: anuragpj |
last post by:
how to insert image in a table in pgsql database.
|
by: gazanfar |
last post by:
Yes thanks
Question is that ---I want to insert image/or image path in my SQlServer 2000
through Visual basic application.like after scan of any photo i want insert in
database on whoever's no...
|
by: shekhar051 |
last post by:
how to insert image as a back ground in header row in C#
|
by: lwannwayoo |
last post by:
Hi Everybody!
I have a database in Microsoft Access 2003 and I want to insert image in my Table Field. How can I don it??. I use OLE type but when i insert image to that field
only the word...
|
by: Napsterr |
last post by:
I have a RichTextEditor control. I want to insert image whereever the cursor is. Onclicking Insert link i want to insert Image.
Is it possible?
I have this design in .aspx page.
After...
|
by: Roamer |
last post by:
Hi, have a problem and do not know hot to solve it.
Image needs to insert where the cursor is.
I have to hit the space bar, select the space, then insert the image (works).
How do I insert...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |