Questions tagged [blob]

A BLOB is a collection of binary data stored as a single entity in a database management system.

A BLOB (binary large object, basic large object, BLOB, or BLOb) is a collection of binary data stored as a single entity in a database management system. Blobs are typically images, audio or other multimedia objects, though sometimes binary executable code is stored as a blob.

Beyond that, the term BLOB has various slightly related usages, see wikipedia for further examples.

7634 questions
69
votes
4 answers

Saving binary data as file using JavaScript from a browser

I am working on a business application using angularJS. One of my service method returning me a byte[] (inclding PDF file content) now i need to download this file as PDF to client machine using JavaScript. How is that possible using HTML5 Apis or…
Ravi Mittal
  • 1,947
  • 4
  • 22
  • 37
67
votes
8 answers

How can I store and retrieve images from a MySQL database using PHP?

How can I insert an image in MySQL and then retrieve it using PHP? I have limited experience in either area, and I could use a little code to get me started in figuring this out.
Mask
  • 33,129
  • 48
  • 101
  • 125
66
votes
1 answer

how does axios handle blob vs arraybuffer as responseType?

I'm downloading a zip file with axios. For further processing, I need to get the "raw" data that has been downloaded. As far as I can see, in Javascript there are two types for this: Blobs and Arraybuffers. Both can be specified as responseType in…
lhk
  • 27,458
  • 30
  • 122
  • 201
66
votes
2 answers

How to check if a variable is a blob in JavaScript

As typeof returns "object".. var MyBlob = new Blob(['test text'], {type : 'text/plain'}); console.log(typeof MyBlob) // "object" is it too early to ask for a generic solution for checking whether or not a variable is a blob as it is not yet widely…
Jaak Kütt
  • 2,566
  • 4
  • 31
  • 39
65
votes
5 answers

HTML5 / Javascript - DataURL to Blob & Blob to DataURL

I have a DataURL from a canvas that shows my webcam. I turn this dataURL into a blob using Matt's answer from here: How to convert dataURL to file object in javascript? How do I convert this blob back into the same DataURL? I've spent a day…
spacecoyote
  • 1,909
  • 3
  • 19
  • 24
63
votes
3 answers

JPA, Mysql Blob returns data too long

I've got some byte[] fields in my entities, e.g.: @Entity public class ServicePicture implements Serializable { private static final long serialVersionUID = 2877629751219730559L; // seam-gen attributes (you should probably edit these) …
onigunn
  • 4,730
  • 10
  • 58
  • 89
61
votes
3 answers

Blob createObjectURL download not working in Firefox (but works when debugging)

I have an odd problem, the function below is one I created based on what i found on the net about creating a Blob in the client on the fly with some binary data in (passed as an array) and being able to download that. This works brilliantly in…
Johncl
  • 1,211
  • 1
  • 12
  • 13
57
votes
5 answers

How do I find the length (size) of a binary blob?

I have an SQLite table that contains a BLOB I need to do a size/length check on. How do I do that? According to documentation length(blob) only works on texts and will stop counting after the first NULL. My tests confirmed this. I'm using SQLite…
Petriborg
  • 2,940
  • 3
  • 28
  • 49
55
votes
3 answers

Easiest way to convert a Blob into a byte array

what is the easiest way to convert a Blob into a byte array?I am using MYSQL and i want to convert a Blob datatype into a byte array. Iam using java programming language:)
androidGuy
  • 5,553
  • 12
  • 39
  • 56
55
votes
8 answers

Storing Documents as Blobs in a Database - Any disadvantages?

The requirements for my document management system were: Must be secure from theft by simple copying of directories, files etc. Must be secure against traditional virus infection (infection of physical file) Must be fast to retrieve The repository…
Johan Bresler
  • 6,450
  • 11
  • 56
  • 77
55
votes
2 answers

Text Field using Hibernate Annotation

I am having trouble setting the type of a String, it goes like public void setTextDesc(String textDesc) { this.textDesc = textDesc; } @Column(name="DESC") @Lob public String getTextDesc() { return textDesc; } and it didn't work, I checked…
bernardw
  • 1,370
  • 3
  • 15
  • 27
52
votes
4 answers

Getting BLOB data from XHR request

var xhr = new XMLHttpRequest(); xhr.open('GET', 'http://static.reddit.com/reddit.com.header.png', true); xhr.responseType = 'arraybuffer'; xhr.onload = function(e) { if (this.status == 200) { var uInt8Array = new Uint8Array(this.response); …
Nick Bennet
  • 533
  • 1
  • 5
  • 4
51
votes
5 answers

How to get a File() or Blob() from an URL in javascript?

I try to upload an image to the Firebase storage from an URL (with ref().put(file))(www.example.com/img.jpg). To do so i need a File or Blob, but whenever I try new File(url) it says "not enough arguments“… EDIT: And I actually want to upload a…
Sam
  • 819
  • 2
  • 7
  • 17
51
votes
1 answer

Content-Security-Policy object-src blob

When using a content-security-policy and I try to follow a process in Chrome 41 (beta) using window.URL.createObjectURL I get an error like the following: Refused to load plugin data from…
Brian M. Hunt
  • 81,008
  • 74
  • 230
  • 343
51
votes
6 answers

How to insert a blob into a database using sql server management studio

How can I easily insert a blob into a varbinary(MAX) field? As an example: thing I want to insert is: c:\picture.png the table is mytable the column is mypictureblob the place is recid=1
Toad
  • 15,593
  • 16
  • 82
  • 128