在flex中上传m4a文件,在oracle中将其保存为blob,并从中检索元数据信息

发布于 2024-08-29 08:10:21 字数 396 浏览 6 评论 0原文

我目前有一个 FileUpload.mxml 组件,它将 .m4a 上传到 Oracle 数据库,从文件中检索元数据并将元数据信息保存在数据库中。

为了实现这一点,我使用 FileReference() 并设置了dispatcher.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,completeHandler);

因此,该文件被发布到一个 php 文件,该文件将其另存为 blob。保存 Blob 后,脚本会向 Flex 发送回消息以调度 upload_complete_data 事件。

在完整的处理程序中,然后通过将值从数据库读回定制的元数据读取器来检索元数据。然后通过 flex 保存元数据信息。

这似乎有点啰嗦。有其他人使用不同的方式成功实现这一目标吗?

I currently have a FileUpload.mxml component that uploads a .m4a to an oracle database, retrieves metadata from the file and saves the metadata info in the database.

to acheive this I use FileReference() and set up, amoung others, the dispatcher.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, completeHandler);

So the file is posted to a php file which saves it as a blob. Once the blob is saved, the script sends a message back to flex to dispatch the upload_complete_data event.

In the complete handler, the metadata is then retreived by reading the value back from the database into a custom made meta data reader. The metadata info is then saved via flex.

This seems a little long winded. Has anyone else successfully achieved this using a different way?

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

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

发布评论

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

评论(1

秋叶绚丽 2024-09-05 08:10:21

充实上面的评论,我在名为 LOADED_FILE 的表中有一个 BLOB(称为 CONTENT)。
我将其转换为 OrdAudio ( setProperties 标志为 true,因为它是您要提取的属性),然后提取元数据位:

select a.content.getAudioDuration( ) ,
       a.content.getCompressionType( ), 
       a.content.getEncoding( ) ,
       a.content.getMimeType( ), 
       a.content.getNumberOfChannels( ), 
       a.content.getSampleSize( ) ,
       a.content.getSamplingRate( )
from (select ordsys.ordaudio(content,1) content from loaded_files)  a;

在正确的应用程序中,我可能会将其存储为 OrdAudio 而不是普通的 blob。

Fleshing out the comment above, I've got a BLOB (called CONTENT) in a table called LOADED_FILE.
I convert it to an OrdAudio (with the setProperties flag to true, as it is the properties you want to extract) and then extract bits of metadata :

select a.content.getAudioDuration( ) ,
       a.content.getCompressionType( ), 
       a.content.getEncoding( ) ,
       a.content.getMimeType( ), 
       a.content.getNumberOfChannels( ), 
       a.content.getSampleSize( ) ,
       a.content.getSamplingRate( )
from (select ordsys.ordaudio(content,1) content from loaded_files)  a;

In a proper app, I'd probably store it as an OrdAudio rather than a plain blob.

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