将图像保存在服务器中 [英] Save Image in the server

查看:93
本文介绍了将图像保存在服务器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友.
我正在做一个asp.net项目,将Oracle作为我的后端数据库.在我正在处理的应用程序中,我必须上传图像并将其保存在服务器中.我必须在将图像保存到Oracle中做出选择数据库或作为服务器中的单独文件,并仅将图像路径保存在数据库中.
哪个选项是最佳选择?我们非常感谢您的帮助.
在此先感谢.

解决方案

我认为将图像保存在数据库中是最好的选择.而不是将映像保存在文件系统中,而将文件路径保存在数据库中.导致是否需要将图像文件移动到服务器的其他位置(由于空间不足或东西过多),因此需要更新数据库中存储的所有路径引用.但是,如果您将整个图像文件以DB格式保存为二进制格式,则数据(图像文件)已经存在于您的系统中.实际上两者都做.不用将图像写入数据库内部,我将使用BFILE将图像存储到文件夹,并同时在文件中创建指针.有关更多信息,请参见:使用LOB和BFILE [ http://research.microsoft.com/apps/pubs/default.aspx?id=64525 [^ ]

是否还取决于图像的使用情况.如果图像大小小于200 KB,则可以使用数据库,否则可以使用文件系统.


Hello friends.
I am working on a asp.net project and Oracle as my back end Database.In the application I am working on, I have to upload images and save it in the server.I have to make a choice between saving the images in the Oracle database or as separate file in the server and save only the image path in the database.
Which option is the best one?Any help is highly appreciated.
Thanks in advance.

解决方案

I think saving the image in database is the best option. rather than saving the image in file system and the file path in database. cause if the image files needs to be moved to a differet location of the server ( due to some space crunch or somthing) all the path references stored in the DB needs to be updated. But in case you save the whole image file in DB as binary format, the data (the image files) is already present in your system.


This is vary biased opinion :) but I would actually do both. Instead of writing the image inside the database I''d use a BFILE to store the image to a folder and also to have the pointer in the file created at the same time. For more information see: Working with LOBs and BFILEs[^]


this article will help you to decide the same:

http://research.microsoft.com/apps/pubs/default.aspx?id=64525[^]

If also depends on the usage of images. if the image size is less than 200 KB, then you can use database otherwise use filesystem.


这篇关于将图像保存在服务器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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