Tag: blob

为什么位于信令服务器上的webrtc blob地址?

我已经使用easyrtc工具包( http://easyrtc.com/ )(为nodejs编写)来在我的办公室networking中build立一个聊天系统。 我没有做太多的工作来实现这个设置,只是简单地使用了工具包提供的演示。 应用程序托pipe在办公室内的虚拟机上,而工具包的默认ICEconfiguration提到位于办公室防火墙之外的STUN和TURN服务器。 系统工作正常,但我有疑问。 在与我的同事坐在办公室的另一台计算机上开始webrtcvideo聊天之后,我在他的video中做了一个“检查元素”。 我期待的blob地址是在他的IP地址,因为我相信我们之间build立了一个点对点的连接。 但IP地址竟然是托pipe应用程序的虚拟机的IP地址。 为什么发生这种情况? <video autoplay="" id="callerVideo" src="blob:http%3A//10.30.23.56/e09742eb-941a-456f-88dc-addfb013c8e9"></video> 这里10.30.23.56是虚拟机的地址。 video来自我的同事的摄像头。

如何将json数组转换为node.js中的BLOBtypes

我有一个包含JSON的数组,我必须将其插入具有数据typesblob列的cassandra数据库表中。 http://www.datastax.com/documentation/cql/3.0/cql/cql_reference/blob_r.html上面的链接说 – 例如,bigintAsBlob(3)是0x0000000000000003和blobAsBigint(0x0000000000000003)是3.但我不能做到这一点为我的场景工作。 我正在使用helenus驱动程序。

Node.js将缓冲区转换为Int8Array

在客户端,我将TypedArray转换为Blob并传输到服务器,以检查数据是否正确,我想比较客户端和服务器端的前五个值, 在客户端: var fileReader = new FileReader(); fileReader.onload = function() { callback(new Int8Array(this.result)); }; fileReader.readAsArrayBuffer(blob); (从中我读了callbackfn中的前五个值) 但在服务器上,我发现代码将blob转换为缓冲区,并从我的理解, buffer和arraybuffer是不一样的, var buffer1 = new Buffer( blob, 'binary' ); 缓冲区有什么类似于DataBuffer的DataView ,现在我如何读取缓冲区1的前5个值作为我能够在客户端做的整数?

EventEmitter内存泄漏

我正在使用meteor。 我build立了一个meteor软件包,帮助上传文件到blob存储。 我得到以下错误。 这个错误在5次中只发生一次。 W20141025-15:22:40.195(5.5)? (STDERR) (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. W20141025-15:22:40.546(5.5)? (STDERR) Trace W20141025-15:22:40.546(5.5)? (STDERR) at addListener (events.js:160:15) W20141025-15:22:40.546(5.5)? (STDERR) at /Users/user/boutfeeds/packages/jamesfebin:azure-blob-upload/.build.jamesfebin:azure-blob-upload/npm/node_modules/azure-storage/lib/common/services/storageserviceclient.js:399:31 W20141025-15:22:40.547(5.5)? (STDERR) at /Users/user/boutfeeds/packages/jamesfebin:azure-blob-upload/.build.jamesfebin:azure-blob-upload/npm/node_modules/azure-storage/lib/common/services/storageserviceclient.js:516:5 W20141025-15:22:40.547(5.5)? (STDERR) at SharedKey.signRequest (/Users/user/boutfeeds/packages/jamesfebin:azure-blob-upload/.build.jamesfebin:azure-blob-upload/npm/node_modules/azure-storage/lib/common/signing/sharedkey.js:81:3) W20141025-15:22:40.547(5.5)? (STDERR) at Object.StorageServiceClient._buildRequestOptions (/Users/user/boutfeeds/packages/jamesfebin:azure-blob-upload/.build.jamesfebin:azure-blob-upload/npm/node_modules/azure-storage/lib/common/services/storageserviceclient.js:498:27) W20141025-15:22:40.634(5.5)? (STDERR) at operation (/Users/user/boutfeeds/packages/jamesfebin:azure-blob-upload/.build.jamesfebin:azure-blob-upload/npm/node_modules/azure-storage/lib/common/services/storageserviceclient.js:255:10) W20141025-15:22:40.634(5.5)? (STDERR) at […]

Uncaught InvalidCharacterError:无法从base64映像转换为blob

我尝试将base64转换为blob,但得到未捕获的错误InvalidCharacterError:无法在'Window'上执行'atob':要解码的string编码不正确。 我testing了我的base64图像数据在这里http://codebeautify.org/base64-to-image-converter它工作正常,我能够看到图像呈现良好 function b64toBlob(b64Data, contentType, sliceSize) { contentType = contentType || ''; sliceSize = sliceSize || 512; var byteCharacters = atob(b64Data); var byteArrays = []; for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) { var slice = byteCharacters.slice(offset, offset + sliceSize); var byteNumbers = new Array(slice.length); for (var i = 0; i […]

压缩(ZIP)给angular度损坏的问题

我正在使用下面的angular度和其他JavaScript库生成zip文件。 $http.post("http://serverURL/downloadAttendanceReport",data,config).success(function(response){ var blob = new Blob([response], {type: "octet/stream"}); var fileName = "Report.zip"; saveAs(blob, fileName); }); 但上面的代码没有给出正确的zip 文件。而打开下载的zip我得到错误:: 加载存档时发生错误。 我的后端(NodeJS)代码是。 var zip = require('express-zip'); ….. res.zip(fileList,'report.zip'); 我得到服务器的回应: PKQ6IJattendance-Next Education.pdf ViT i= MCDP(Z K% 9 Zihك 2V " 0 BC ":r U AY\m E 1ꑀ 0ttz W } {_ ӑa < wucl f +" x H […]

将图像,video上传到Node.js WebService并存储在Azure Blob存储中

我已经创build了一个Node.js Web服务,它在后主体和在同一个对象我需要传递图像/video(不知道是否有可能)媒体文件和相同的媒体文件需要上传到Azure Blob存储。 Azure存储提供了我们上传stream的库。 但是,在上传到Azure blob存储之前,如何将文件从应用上传到node.js服务器。 这个概念必须在Windows,Android和IOS平台上运行。

成功将base64映像保存到Azure Blob存储,但blob映像始终损坏/小的白色框

我有一个图像转换为base64我想上传到我的azure色blob存储使用createBlockBlobFromText。 self.blobServer.createBlockBlobFromText(containerName, fileName, baseStrChars, { contentSettings: { contentType: 'image/jpeg' } }, function(error, result, response) { if (error) { console.log(error); } console.log("result", result); console.log("response", response); }); 我新的JPEG图像出现在BLOB存储容器,但是当我去blob图像的URL我总是得到这个 。 我的容器的访问策略设置为容器,我粘贴我的base64string到base64图像转换器,并出现正确的图像。 这个问题似乎是我创buildblob而不是base64string的方式。 我感到困惑,为什么整个stream程似乎工作,但仍然是图像被打破,当我去的url。 有任何想法吗 ?

将二进制数据从Nodejs缓冲区写入Meteor客户端的blob

我试图创build一个CSV文件,将在服务器上以UTF-16LE编码进行保存,然后将结果传递给客户端。 这就是我在Coffeescript中所做的: Meteor.methods { iconv: (data, from="UTF-8", to="UTF-16LE") -> Iconv = Meteor.require('iconv').Iconv iconv = new Iconv(from, to) res = iconv.convert(data) res } 现在,如果我用线路从服务器写入文件 fs.writeFileSync('/tmp/test.csv', res) 该文件正确生成。 但是,我想避免在服务器上创build一个文件,并将其直接保存在客户端(使用filesaver库 )。 示例客户端代码如下所示: exportToCsv = (data="tête", filename) -> callback = (err, res) -> blob = new Blob([res], {type:'text/csv;charset=UTF-16LE'}) saveAs(blob, filename) Meteor.call('iconv', data, callback) 正如你所看到的,我testing的数据是一个带有特殊字符('ê')的简单string。 我的问题是我无法将nodejs缓冲区传递给客户端。 它被自动序列化为: Object {0: 116, […]

如何使用node.js从Bookshelf.js文件中插入BLOB数据?

我在node.js中使用multer处理file upload。 我需要将文件数据存储在表中的blob字段中。 有没有办法将文件指针绑定到Bookshelf.js?