blob

vue项目,前端导出excel

☆樱花仙子☆ 提交于 2019-11-26 19:20:54
今天研究一下前端如何导出excel,边查边实践,边记录 1.安装依赖库 xlsx:这是一个功能强大的excel处理库,但是上手难度也很大,还涉及不少二进制的东西 file-saver:ES5新增了相关file,blob,fileList等API,但不是所有浏览器都支持,file-saver在没有原生支持saveAs的浏览器上实现了saveAs()接口 script-loader: 在全局上下文环境中执行一次js脚本。 二、引入相关依赖 上述部分依赖不支持import引入,所以需要使用'script-loader'将他们挂载到全局环境下; 其中的blob.js是github上的一个开源文件,对于浏览器不能原生支持blob的情况,提供了兼容解决方案,其地址是:https://github.com/eligrey/Blob.js script-loader使用方法: require('script-loader!file-saver'); //保存文件用 require('script-loader!vendor/Blob'); //转二进制用 require('script-loader!xlsx/dist/xlsx.core.min'); //xlsx核心 /* eslint-disable */ /* Blob.js * A Blob implementation. * 2014

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

寵の児 提交于 2019-11-26 19:17:43
问题 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 Chrome, but doesn't do anything in Firefox - UNLESS I debug and step through the code. Yes, oddly, if I create a break point inside the function and step through it, the a.click() will bring up the download window! function downloadFile(filename, data)

Pass Blob through ajax to generate a file

淺唱寂寞╮ 提交于 2019-11-26 18:50:29
I'm trying to capture audiorecorder ( https://github.com/cwilso/AudioRecorder ) and send the blob through Ajax a php file, which will receive the blob content and create the file(the wave file in this case). Ajax call: audioRecorder.exportWAV(function(blob) { var url = (window.URL || window.webkitURL).createObjectURL(blob); console.log(url); var filename = <?php echo $filename;?>; $.ajaxFileUpload({ url : "lib/vocal_render.php", secureuri :false, dataType : blob.type, data: blob, success: function(data, status) { if(data.status != 'error') alert("boa!"); } }); }); and my php file (vocal_render

Windows Azure Storage Explorer List

落花浮王杯 提交于 2019-11-26 18:29:57
现在有一些Azure storage explorer工具,下面是列表,share方便大家下载。好像Windows Azure tool for visual studio 2010 1.2也集成readolny的storage explorer(没有用过). 使用了几种工具,感觉 Cloud Berry Explorer for Windows Azure Blob 和 Windows Azure Management Tool 都不错。不过 Cloud Berry Explorer 是需要注册(免费注册). 而 Azure Storage Explorer (3.0 bata, 2009.11)有些功能并没有实现,在查询时比较麻烦和慢,也没有找到源代码可供修改. Windows Azure Storage Explorer Block Blob Page Blob Tables Queues Free Azure Blob Client X Y Azure Blob Compressor Enables compressing blobs for upload and download X Y Azure Blob Explorer X Y Azure Storage Explorer X X X Y Azure Storage Simple Viewer X X X Y

Storing a small number of images: blob or fs?

断了今生、忘了曾经 提交于 2019-11-26 17:53:22
I'm adding some functionality to my site so that users can upload their own profile pictures, so I was wondering about whether to store them in the database as a BLOB, or put them in the file system. I found a question similar to this here: Storing images in DB: Yea or Nay , but the answers given were geared more towards people expecting many many thousands or even millions of images, whereas I'm more concerned about small images (JPEGs up to maybe 150x150 pixels), and small numbers of them: perhaps up to one or two thousand. What are the feelings about DB BLOB vs Filesystem for this scenario?

Is there any way to insert a large value in a mysql DB without changing max_allowed_packet?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 17:49:22
问题 I know that in order to insert values larger than max_allowed_packet bytes into a MySQL database, the default solution would be to assure that both client and server side max_allowed_packet variables are bigger than the chunk of data that a query inserts into the DB. However, is there any way to do so without changing the server side variable mentioned above? This would be useful when I have to insert data into a database that is hosted in an ISP that doesn't allow me to change the max

PDF Blob is not showing content, Angular 2

一笑奈何 提交于 2019-11-26 17:38:42
I have problem very similar to this PDF Blob - Pop up window not showing content , but I am using Angular 2. The response on question was to set responseType to arrayBuffer, but it not works in Angular 2, the error is the reponseType does not exist in type RequestOptionsArgs. I also tried to extend it by BrowserXhr, but still not work ( https://github.com/angular/http/issues/83 ). My code is: createPDF(customerServiceId: string) { console.log("Sending GET on " + this.getPDFUrl + "/" + customerServiceId); this._http.get(this.getPDFUrl + '/' + customerServiceId).subscribe( (data) => { this

Can I set the filename of a PDF object displayed in Chrome?

删除回忆录丶 提交于 2019-11-26 17:28:04
问题 In my Vue app I receive a PDF as a blob, and want to display it using the browser's PDF viewer. I convert it to a file, and generate an object url: const blobFile = new File([blob], `my-file-name.pdf`, { type: 'application/pdf' }) this.invoiceUrl = window.URL.createObjectURL(blobFile) Then I display it by setting that URL as the data attribute of an object element. <object :data="invoiceUrl" type="application/pdf" width="100%" style="height: 100vh;"> </object> The browser then displays the

MySQL的数据类型

删除回忆录丶 提交于 2019-11-26 17:14:57
一、MySQL的数据类型 主要包括以下五大类: 整数类型:BIT、BOOL、TINY INT、SMALL INT、MEDIUM INT、 INT、 BIG INT 浮点数类型:FLOAT、DOUBLE、DECIMAL 字符串类型:CHAR、VARCHAR、TINY TEXT、TEXT、MEDIUM TEXT、LONGTEXT、TINY BLOB、BLOB、MEDIUM BLOB、LONG BLOB 日期类型:Date、DateTime、TimeStamp、Time、Year 其他数据类型:BINARY、VARBINARY、ENUM、SET、Geometry、Point、MultiPoint、LineString、MultiLineString、Polygon、GeometryCollection等 1、整型 MySQL数据类型 含义(有符号) tinyint(m) 1个字节 范围(-128~127) smallint(m) 2个字节 范围(-32768~32767) mediumint(m) 3个字节 范围(-8388608~8388607) int(m) 4个字节 范围(-2147483648~2147483647) bigint(m) 8个字节 范围(+-9.22*10的18次方) 取值范围如果加了unsigned,则最大值翻倍,如tinyint unsigned的取值范围为