`
- 浏览:
9311 次
-
gridfs与spreadsheet接口的问题解决办法
Gridfs是mongodb专用存储文件的,相当于附件
Spreadsheet是解析excel格式文件的
环境:
Rails 3.0.9
ruby 1.9.2
spreadsheet 0.6.5.4
网上关于这方面的资料很多,很全
首先需要引入头文件
require 'spreadsheet'
require 'mongoid_grid'
这里用的是插件
attachment :file就能实现相应的附件的存取很方便
取的时候直接file.read即可,要是想去文件名的话只要file.filename即可
本人菜鸟,猜测file.read出的文件在内存流中(没有经过验证),于是想用spreadsheet打开该file可是一直报错,spreadsheet中介绍,只支持io_or_path路径估计不行了,io又不了解,后来请教的高手加了一句StringIO.new(self. file.read)
再用spreadsheet.Open()就能够打开了。
有关spreadsheet的用法请看夜鸣猪的微博写的很详细
http://hlee.iteye.com/blog/356510
鉴于本人相当菜欢迎各位前来探讨。指教呵呵
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
网格文件系统mongodb GridStore 的兼容“fs”接口。 例子: var GridFS = require ( 'gridfs' ) ;var fs = require ( 'fs' ) ;var gfs = new GridFS ( mongo , db , 'files' ) ;gfs . open ( '554385768a812acf16c3...
Linux利用nginx-gridfs搭建部署,nginx-gridfs-0.8 可用
NULL 博文链接:https://chwshuang.iteye.com/blog/2065974
mongdb+GridFS文件上传
Laravel开发-gridfs 使用laravel上的gridfs存储文件、图像和文档
Mongodb的gridfs的C#的例子
gridfs-nginx-plugingridfs-nginx-plugingridfs-nginx-plugingridfs-nginx-plugingridfs-nginx-plugingridfs-nginx-plugingridfs-nginx-plugingridfs-nginx-plugingridfs-nginx-plugingridfs-nginx-plugingridfs-...
NULL 博文链接:https://happyjin2010.iteye.com/blog/1757161
Mongodb基于GridFS存储文件,通过流的方式存储文件图片,以及读取功能。本人亲自测试、编写。值得信赖
linux nginx-gridfs下载资料,保护下载文档,包;内网安装,内网环境使用;有需要的朋友看看,对自己学习工作都很有帮助
功能:基于mongodb gridfs实现简单文件上传、下载、搜索、删除。 开发环境:VS2012 mongodb驱动:官方Driver 上传控件:jquery uploadify 疑问:sort()方法可能有点问题 PS:有问题可以留言,欢迎交流~
Laravel开发-laravel-gridfs-storage 用于Laravel存储API的MongoDB GridFS集成
linux gridfs图片服务器和rmtp流媒体服务器部署完成 技术:gridfs图片服务器 rmtp流媒体服务器 说明包含: nginx+grids+rmtp安装包 nginx+gridfs+rtmp服务器部署帮助文档.docx linux内网生产环境使用;文档比较...
MongoDB.GridFS.dll c#类库...............................................
NULL 博文链接:https://shift-alt-ctrl.iteye.com/blog/2195646
nginx-gridfs-0.8.tar.gz
MongoDB原子操作与GridFS.pdf 学习资料 复习资料 教学资源
通过Nginx直接在页面上通过URL访问MongoDB存储的文件
也-gridfs 也+ gridfs
springboot 操作mongodb(包含GridFs存储文件),适合对mongodb感兴趣的java开发者