Filemaker GetAs ...如何在网页上显示容器字段? [英] Filemaker GetAs...How to display Container Field on webpage?

查看:214
本文介绍了Filemaker GetAs ...如何在网页上显示容器字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.Net应用程序,该应用程序需要显示存储在Filemaker Container字段中的图像.我的查询语句如下:

I have an ASP.Net application that needs to display an image that is stored in a Filemaker Container field. My query statement looks like:

SELECT GetAs(Image, 'JPG') FROM UA_Item_Pictures WHERE "Stock Number" = 33989 AND ImageOrder = 1

根据文档: 您可以从FileMaker数据库文件的容器字段中检索的可能文件类型(区分大小写)为:

According to the documentation: The possible file types (case sensitive) you can retrieve from a container field in a FileMaker database file are:

'EMBO' OLE容器数据

'EMBO' OLE container data

'PDF' 便携式文件格式

'PDF ' Portable Document Format

"EMF +" Windows增强型图元文件加

'EMF+' Windows Enhanced Metafile Plus

"PICT" Mac OS(没有基于512字节文件的标头)

'PICT' Mac OS (does not have 512-byte file-based header)

'EPS' 嵌入式PostScript

'EPS ' Embedded PostScript

'PNGf' 位图图像格式

'PNGf' Bitmap image format

文件" 插入文件命令的结果

'FILE' Result of an Insert File command

"PNTG" MacPaint

'PNTG' MacPaint

"FPix" Flash(FPX)

'FPix' Flash (FPX)

'qtif' QuickTime图片文件

'qtif' QuickTime image file

叉" 资源派生(Mac OS)

'FORK' Resource fork (Mac OS)

'.SGI' 通用位图格式

'.SGI' Generic bitmap format

'GIFf' 图形交换格式

'GIFf' Graphics Interchange Format

'snd' 标准声音(Mac OS原始格式)

'snd ' Standard sound (Mac OS raw format)

'JPEG' 摄影图像

'JPEG' Photographic images

"TIFF" 数字图像的光栅文件格式

'TIFF' Raster file format for digital images

'JP2' JPEG 2000

'JP2 ' JPEG 2000

'TPIC' 塔尔加(Targa)

'TPIC' Targa

"META" Windows图元文件(增强)

'META' Windows Metafile (enhanced)

"XMLO" 布局对象

'XMLO' Layout objects

'METO' Windows图元文件(原始)

'METO' Windows Metafile (original)

"8BPS" PhotoShop(PSD)

'8BPS' PhotoShop (PSD)

'moov' 旧的QuickTime格式(Mac OS)

'moov' Old QuickTime format (Mac OS)

因此,根据这些信息,我的问题是:

So with this information, my questions are:

  1. 如何检索多种格式的内容?
  2. 如何将BLOG渲染为页面上的图像?

任何建议将不胜感激!

推荐答案

这是因为您使用的是JPG而不是JPEG,实际上,您的问题得到了回答.您可以这样阅读

It is because you are using JPG instead of JPEG, in fact, your question answers itself. You can read it this way

SELECT GetAs(Image, 'JPEG') ...

然后,如果您使用的是ado.net,请以这种方式阅读

And then, if you are using ado.net read it this way

var bytesLength = reader.GetBytes(0, 0, null, 0, 0);
var buffer = new Byte[bytesLength];
var bytes = reader.GetBytes(0, 0, buffer, 0, (int)bytesLength);
using (var fileStream = new FileStream(String.Format("{0}.jpg", Guid.NewGuid().ToString()), FileMode.Create, FileAccess.Write)) {
    fileStream.Write(buffer, 0, buffer.Length);
}

GetBytes函数开始时的0表示照片字段的索引.

Where 0 at the beggining of the the GetBytes function is the index of the photo field.

这篇关于Filemaker GetAs ...如何在网页上显示容器字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆