blob

html image blob to base64

你离开我真会死。 提交于 2019-12-05 19:10:06
I've got some problems about to fileinputjs.The images' src are blob.But i want to use images' src to do something.So i use readAsDataURL to get base64.But there are any problems about it 。 <script type="text/javascript"> $("#last").click(function(){ var blob=document.querySelector(".file-preview-image").src; var reader = new FileReader(); //通过 FileReader 读取blob类型 reader.onload = function(){ this.result === dataURI; //base64编码 } console.log(reader.readAsDataURL(blob)); }) </script> Then there are Uncaught TypeError: Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type

oracle--导出、导入blob类型的字段

烂漫一生 提交于 2019-12-05 18:03:55
以下操作记录了blob字段的导出、导入方法流程 。 方法原理:利用UTL_FILE将blob字段的内容以二进制的形式导出到txt文档,然后用dbms_blob将文档内容导入到指定的数据库表中。 1、 创建一个文本文档来保存blob数据。   这里在E盘home/dhl下创建一个名为text.txt的文件。 2、 创建oracle临时目录 1 create or replace directory UTL_FILE_DIR as 'E:/home/dhl/'; 2 GRANT read ,write ON DIRECTORY UTL_FILE_DIR TO PUBLIC; 注意: 目录下面要有text.txt的文件 3、 导出blob数据 这里以SVS.SVS_ACCADM_SEALINFO表这张数据表为例子,其中的SEAL就是BLOB类型的字段 1 DECLARE 2 file_handle UTL_FILE.FILE_TYPE; 3 b_lob BLOB; 4 BEGIN 5 select SEAL into b_lob from SVS.SVS_ACCADM_SEALINFO where ID='100007922'; 6 7 file_handle := utl_file.fopen('UTL_FILE_DIR', 'test.txt', 'WB'); 8 utl_file

bad value for type long: - Postgresql, Hibernate, Spring

戏子无情 提交于 2019-12-05 15:40:38
问题 I wanna store an entity(a String + an image) in PostgresQL using Spring MVC and Hibernate Here is my table. The image is supposed to be the type of oid. CREATE TABLE document ( name character varying(200), id serial NOT NULL, content oid, // that should be the image CONSTRAINT document_pkey PRIMARY KEY (id ) ) WITH ( OIDS=FALSE ); Here is the entity that I want to store. @Entity @Table(name = "document") public class Document { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column

Javascript: how to convert hex data to binary and write it into a file

99封情书 提交于 2019-12-05 13:05:11
I have a bunch of hex values and I have to convert it into binary data before write them into a file. I trasformed the hex string in an array of integers, then I convert each integer to a char: // bytes contains the integers str = String.fromCharCode.apply(String, bytes); now I create the blob file and download it: var blob = new Blob([str], {type: "application/octet-stream"}); saveAs(blob, "file.bin"); but something goes wrong: if I print the length of bytes and the length of str I have the same value ( 512 ), but the file contains 684 chars, and of course it isn't how I expect it. So I have:

Mysql学习笔记一

大憨熊 提交于 2019-12-05 12:28:23
最近在学习mysql,以后工作会慢慢往这方面转向,所以提前预习。~~~ 现在全世界都喊着去IOE,所以咱也必须提前做个准备。冲................ 第一章基础知识 1、改变表结构 增加列:alter table test add name(char(6)); 更改列定义:alter table test change year_born bithday; 改变列的名称:alter table test modify oldname newname; 2、表的改名有以下方法: alter table aa rename bb; alter table aa rename to bb; rename aa to bb; 3、指定日期格式: select date_format(birtyday,'%m/%d/%Y'); 这个与oracle不太一样。 %m返回月份(01-12),%d返回日期(01-31),%Y返回四位数的年份,%W返回星期,%M返回月份的名字,%y返回两位数的年份。 4、返回当前日期和时间 select now(),current_date(); now()返回日期和时间。 有一个列类型datetime,格式以YYYY-MM-DD HH:MM:SS存储数据。 第2章 数据类型和表类型 在mysql中,数据库名与表名的大小写是相关的,如在windows下不相关

How Do I get the Name of The inputBlob That Triggered My Azure Function With Python

我与影子孤独终老i 提交于 2019-12-05 12:18:45
问题 I have an azure function which is triggered by a file being put into blob storage and I was wondering how (if possible) to get the name of the blob (file) which triggered the function, I have tried doing: fileObject=os.environ['inputBlob'] message = "Python script processed input blob'{0}'".format(fileObject.fileName) and fileObject=os.environ['inputBlob'] message = "Python script processed input blob'{0}'".format(fileObject.name) but neither of these worked, they both resulted in errors. Can

How to INSERT binary std::string into BLOB

牧云@^-^@ 提交于 2019-12-05 10:33:06
I have binary std::string and I need insert it into the BLOB (MySQL) using simple data layer I have. So, I need to execute query: ExecuteSQL((LPTSTR)strQ) . When I am creating this query string (strQ) I cannot add anything to the string after I add this binary string - it just kind if terminated and nothing can be added. I do not want to use mysql_real_escape_string because i want to keep it not only for MySQL. Anybody to HELP PLEASE!!! Assuming you have code that looks something like this: std::string s = ... // populate string somehow ExecuteSQL( (LPCSTR) s ); Then you have several problems.

Is there a way to do symbolic links to the blob data when using Azure Storage to avoid duplicate blobs?

混江龙づ霸主 提交于 2019-12-05 10:25:17
I have a situation where a user is attaching files within an application, these files are then persisted to Azure Blob storage, there is a reasonable likelihood that there are going to be duplicates and I want to put in place a solution where duplicate blobs are avoided. My first thought is to just name the blob as filename_hash but that only captures a subset of duplicates, then filesize_hash was then next thought. In doing this though it seems like I am losing some of the flexibility of the blob storage to represent the position in a hierarchy of the file, see: Windows Azure: How to create

mysql物理设计

╄→尐↘猪︶ㄣ 提交于 2019-12-05 09:49:47
定义数据库,及表的命名规范: 1,数据库,表及字段的命名要遵循可读性原则, 表意性原则, 长名原则(不尽量或者不使用缩写,使用长一些的命名,这样以后会看起来更明白,但是也不太非常的长) 通一 主键的名称,比如是 id或者是 _id 等,这样比较好管理。表里面的字段命名也不需要带上表名什么的。什么意思就是什么意思就好,没必要搞得这样子。不过表命名可以 可是 模块的名称 作为前缀 ,比如有一个 模块 crm ,那么 crm 模块里面 用到的表是 user ,那么表名 就起为 crm_user这样比较好识别和 管理。 个人认为尽量不要使用 uuid 的bigint ,一般的小中型项目,int无符号都可以满足了。 对于分布式的主键呢。 一般都是使用 varchar 的 UUID,这样比较方便管理和使用对于分布式来说。 但是对于一些对接其他系统的场景,ID可能会让你痛不欲生,而洗数据也是体力活儿。如果ID过长极容易产生前端显示问题,毕竟js的long是15位的。所以实际运用中ID长度也要严格把控。所以UUID 才保存为varchar类型,而不是 bigint 这样比较方便写代码和传给客户端,不用进行 类型转换了。 文/codertom(简书作者) 原文链接:http://www.jianshu.com/p/a3828b42fce8 著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”

HSQLDB and .lobs file size

那年仲夏 提交于 2019-12-05 09:34:08
I'm using a HSQLDB database in Java which stores files in a column defined as a BLOB. When I add a table row with a file/BLOB to my table the .lobs file increases in size of the file/BLOB. When I add another file to my table it increases in size again (2 x BLOB size). So, I implemented a test method which iterates 10 times and writes the same file to my table and deletes it right after the insert. Now, my .lobs file is 10 x file size... even though I've deleted all the table rows which contained the file. I've tried to execute CHECKPOINT DEFRAG but nothing happens. The .lobs file stay the same