blob

Decoding blob data from a sqlite database into a human readable text

好久不见. 提交于 2019-12-02 11:43:24
问题 I have a Sqlite database file that has blob data in it. I only know the the database has blob data and I know what the expected output should be. The blob data's expected output should be a Mac address with other text. I tried getting the hex output but does not really help me with getting the expected output that I know is in the database. I also used a Hex editor and sqlite viewer but only shows gibberish unreadable text. Here is some code that I tried to get the bytes from the blob data

Display image from sql

回眸只為那壹抹淺笑 提交于 2019-12-02 11:25:54
问题 I've create a table where I've saved images through "BLOB". I need to show those images along with other items. But I don't know how to show those images together in the same page. Here's my php code that displays other things in form of a table. Similarily, I wanted to display images accordingly. Any help? <?php $display_query = mysql_query("SELECT * FROM eportal"); echo "<table id='pageTable'><thead><tr><th>Item code</th><th>Description</th><th>Cost</th></tr></thead>"; echo "<tbody>"; while

Store image in MySQL BLOB

早过忘川 提交于 2019-12-02 11:19:38
问题 I'm storing small thumbs in a MySQL database. With PHP i create a thumbnail from an image and i simply store that into a BLOB column. It seems that MySQL saves the binary image as a Base64 string in the database. The problem is that MySQL seems to store it as a application/octet-stream instead of jpg file. I know that because i tested the Base64 string with this code: <?php $encoded_string = "...."; $imgdata = base64_decode($encoded_string); $f = finfo_open(); $mime_type = finfo_buffer($f,

Copying data from LOB Column to Long Raw Column

主宰稳场 提交于 2019-12-02 10:44:16
I was looking for a query which picks data from a table having Blob column and update a table having LONG RAW column. It seems Oracle supports only up to 4000 characters. Is there a way to copy full data from blob to long raw. I was using the follwing query insert into APPDBA.QA_SOFTWARE_DUMMY select SOFTWARE_ID, UPDATED_BY, CREATE_CHANGE_DATE, FILE_NAME, DBMS_LOB.SUBSTR(SOFTWARE_FILE, 4000) SOFTWARE_FILE, SOFTWARE_TYPE from APPDBA.QA_SOFTWARE_DUMMY_TEST ; but DBMS_LOB.SUBSTR supports only upto 4000 characters. Any help is highly appreciated. Vincent Malgrat PL/SQL will only read/write the

BLOB URL not working in Safari

狂风中的少年 提交于 2019-12-02 10:37:56
问题 I'am using D3 to generate a graph and want to export this to an image, which works fine in all browsers except Safari. The code generates a D3 SVG, which is used in a BLOB, which is used as an image, which is added to a canvas which can be exported. var blob = new Blob([source], { type: 'image/svg+xml;charset=utf-8' }); var url = window.URL.createObjectURL(blob); // Put the svg into an image tag so that the Canvas element can read it in. var img = d3.select('body').append('img') .attr('width'

Extended ASCII characters in Oracle Text blob not loading into HIVE correctly, showing as '?' instead

六月ゝ 毕业季﹏ 提交于 2019-12-02 10:13:39
I have text blob data in oracle and I have imported using sqoop into HIVE in Binary. Source blob is textual data with extended ASCII characters in it but in HIVE these special characters are not correct in HIVE. I have tried by creating table using hcat -e and then loaded data in hive using sqoop with hcatalog. I have tried using hcatalog. Created table with Blob in oracle, then created equivalent table in HIVE but set as Binary instead of Blob. Insert sample data with text and special charaters, then imported data using Sqoop. Create table test_blob (col1 integer not null primary key, col2

how to convert byte array to pdf and download

こ雲淡風輕ζ 提交于 2019-12-02 10:11:56
I am trying to do a simple task of downloading a http response to a pdf. I am generating a pdf file but I am getting an error of "Failed to open PDF". Here is what the response looks like. And here is what I am doing. let blob = new Blob([response.data], { type: 'application/pdf' }) FileSaver.saveAs(blob, 'foo.pdf') The string from the response seem to be Base-64 encoded (ref. fiddle). You can decode it using fetch() (or XMLHttpRequest() for older browsers): fetch("data:application/pdf;base64," + response.data) .then(function(resp) {return resp.blob()}) .then(function(blob) { FileSaver.saveAs

How to avoid encoding warning when inserting binary data into a blob column in MySQL using Python 2.7 and MySQLdb

拈花ヽ惹草 提交于 2019-12-02 10:04:48
I'm having trouble inserting binary data into a longblob column in MySQL using MySQLdb from Python 2.7, but I'm getting an encoding warning that I don't know how to get around: ./test.py:11: Warning: Invalid utf8 character string: '8B0800' curs.execute(sql, (blob,)) Here is the table definition: CREATE TABLE test_table ( id int(11) NOT NULL AUTO_INCREMENT, gzipped longblob, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; And the test code: #!/usr/bin/env python import sys import MySQLdb blob = open("/tmp/some-file.gz", "rb").read() sql = "INSERT INTO test_table

How to manage responseType = 'blob' using Angular5 in Front end

不打扰是莪最后的温柔 提交于 2019-12-02 09:41:17
I want to download a doc.pdf that have a text 'My first file download' . When I try to download to zip file, my file have some files.xml Like in this photo Can you suggest me how to convert this file in pdf? Please follow my code: Component.ts export(id: string) { this.ss.download(id) .subscribe(data => { console.log(`excel data: ${data}`); FileSaver.saveAs(data, 'doc.zip') }, error => console.log('Error downloading the file.'), () => console.log('Completed file download.')); } service.ts: public download(id: string): Observable<any> { //let oReq = new XMLHttpRequest(); // let options = new

MySQL count(*) everyday in a month returns [BLOB-2B] instead of number

≡放荡痞女 提交于 2019-12-02 08:54:30
I'm going to count every rows each day in a month with a specific user id(vwr_tid). Everything works fine - the result shows up in a table but one thing. A count each days doesn't comes up. It becomes [BLOB-xx] instead of number of rows that day. Here is my code : SELECT MONTH_v, YEAR_V, GROUP_CONCAT(IF(day_v=1, views, null)) AS '1', GROUP_CONCAT(IF(day_v=2, views, null)) AS '2', GROUP_CONCAT(IF(day_v=3, views, null)) AS '3', GROUP_CONCAT(IF(day_v=4, views, null)) AS '4', GROUP_CONCAT(IF(day_v=5, views, null)) AS '5', GROUP_CONCAT(IF(day_v=6, views, null)) AS '6', GROUP_CONCAT(IF(day_v=7,