Filemaker GetAs...如何在网页上显示容器字段?

发布于 2024-08-10 13:47:05 字数 986 浏览 2 评论 0原文

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

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

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

“EMBO” OLE 容器数据

“PDF” 便携式文档格式

“EMF+” Windows 增强型图元文件 Plus

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

“EPS” 嵌入 PostScript

'PNGf' 位图图像格式

“文件” 插入文件命令

“PNTG” 的结果 MacPaint

'FPix' 闪存 (FPX)

“qtif” QuickTime 图像文件

“FORK” 资源分支 (Mac OS)

'.SGI' 通用位图格式

“GIFf” 图形交换格式

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

“JPEG” 摄影图像

“TIFF” 的光栅文件格式

数字图像“JP2” JPEG 2000

“TPIC” 塔加

“META” Windows 图元文件(增强)

“XMLO” 布局对象

“METO” Windows 图元文件(原始)

“8BPS” PhotoShop (PSD)

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

因此,有了这些信息,我的问题是:

  1. 如何检索多种格式的内容?
  2. 如何将博客呈现为页面上的图像?

任何建议将不胜感激!

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

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 container data

'PDF '
Portable Document Format

'EMF+'
Windows Enhanced Metafile Plus

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

'EPS '
Embedded PostScript

'PNGf'
Bitmap image format

'FILE'
Result of an Insert File command

'PNTG'
MacPaint

'FPix'
Flash (FPX)

'qtif'
QuickTime image file

'FORK'
Resource fork (Mac OS)

'.SGI'
Generic bitmap format

'GIFf'
Graphics Interchange Format

'snd '
Standard sound (Mac OS raw format)

'JPEG'
Photographic images

'TIFF'
Raster file format for digital images

'JP2 '
JPEG 2000

'TPIC'
Targa

'META'
Windows Metafile (enhanced)

'XMLO'
Layout objects

'METO'
Windows Metafile (original)

'8BPS'
PhotoShop (PSD)

'moov'
Old QuickTime format (Mac OS)

So with this information, my questions are:

  1. How do I retrieve contents with multiple formats?
  2. How do I render the BLOG into an image on the page?

Any suggestions would be much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

国产ˉ祖宗 2024-08-17 13:47:05

谢谢,但我想我知道发生了什么事。如果我在图像表和另一个表之间进行内部联接,则图像不会被返回(或正确返回......不确定是哪一个)。一旦我直接对图像表运行查询,就会返回图像。

所以这不起作用:
select * from biography_table b 内联 image_table i on b.stocknumber = i.stocknumber
其中 b.stocknumber = 12345

但这确实:
select * from image_table where stocknumber = 12345

这意味着我必须运行 2 个单独的查询,但至少我看到了数据!

Thanks, but I think I found out what was going on. If I did an inner join between an image table and another table, the image wasn't being returned (or being returned properly...not sure which). As soon as I ran a query against the image table directly, images were returned.

So this did not work:
select * from biography_table b inner join image_table i on b.stocknumber = i.stocknumber
where b.stocknumber = 12345

But this does:
select * from image_table where stocknumber = 12345

This means I have to run 2 separate queries, but at least I'm seeing data!!

小情绪 2024-08-17 13:47:05

如果您无法预测文件类型,并且/或者您需要使用其他扩展名(例如 docx、xlsx 等),那么您可以专门将“FILE”用于所有存储和检索脚本。

然而,这样做意味着 FileMaker 本身并不知道如何处理和打开文件。换句话说,使用 FileMaker 时,您需要手动导出字段的内容来编辑/查看它,而不是简单地双击字段并打开文件。因此,该设置要么有利于 FileMaker,要么有利于您的外部应用程序。

如果您这样做,容器字段中的所有文件将被称为“Untitled.dat”,其内部名称将为“?”,因此您还需要在另一个字段中存储实际文件名或其扩展名,以便您可以稍后再打开。

If you cannot predict what the file type will be, AND/OR you need to use other extensions (such as docx, xlsx, etc), then you can exclusively use 'FILE' for all of your storage and retrieval scripts.

However doing it this way means that FileMaker does not know natively how to handle and open the file. In other words, when using FileMaker you will need to manually export the contents of the field to edit/view it, instead of being able to simply double click the field and it opens the file. So either the setup is advantageous to FileMaker, or advantageous to your external application.

If you do it this way, all files in container fields will be called 'Untitled.dat' and their internal name will be '?', so you will also need to store in another field the actual file name or its extension so you can open it later.

烟─花易冷 2024-08-17 13:47:05

这是因为你使用的是 JPG 而不是 JPEG,事实上,你的问题已经有了答案。您可以这样阅读

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

然后,如果您使用的是 ado.net,请这样阅读

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 是照片字段的索引。

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') ...

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);
}

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

另类 2024-08-17 13:47:05

购买 SuperContainer 的许可证(无耻插件警告:我是作者之一)和一台 Mac Mini托管它。将文件从容器字段移入 SuperContainer,并让 SuperContainer 通过利用 OS X 的 CoreImage 库来渲染文件的图像版本。

Buy a license of SuperContainer (shameless plug alert: I'm one of the authors) and a Mac Mini to host it on. Move the files out of your container fields and into SuperContainer, and let SuperContainer render image versions of your files by tapping into OS X's CoreImage libs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文