用于将图像文件转换为二进制格式以存储在数据库中的C代码 [英] C code for converting an image file into binary format for storing in a database

查看:93
本文介绍了用于将图像文件转换为二进制格式以存储在数据库中的C代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何将jpg图像文件转换为二进制代码格式。它们将以这种格式存储在数据库中。

I would like to know how to convert a jpg image file into binary code format. They are to be stored in a database in this format.

推荐答案

你真的不应该这样做!您最好在应用程序中创建一些文件服务(具有唯一和原始文件名),并将文件存储在没有数据库的服务器上的某个目录中。



仅比您需要在存储时将文件复制到服务器,并在检索时将其复制回而不进行任何其他操作。它节省了大量的执行和开发时间,避免了大量的错误!!!
you really shouldnt do that! You better create some file service (with unique and the original filename) in your app and store the file in some directory on a server without the database.

Than you only need to copy the file to server on storing and copy it back on retrieving WITHOUT any additional operation. It saves a lot of execution and development time and avoids tons of errors!!!


图像已经是二进制格式,只需将它们粘贴在数据库中...我一直这样做。



你的问题太过模糊了,无论如何都不能回答....下次尝试这样的事情:



使用C风格的Windows应用程序在Oracle数据库中存储图像的好方法是什么?
Images are already in binary format, just stick them in the database ... I do it all the time.

Your question is far too vague to answer anyway .... try something like this next time:

"What would be a good way to store images in an Oracle database with a C style Windows application?"


这篇关于用于将图像文件转换为二进制格式以存储在数据库中的C代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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