将图像保存到sql server或文件夹名称中.Web应用程序中的图像 [英] Save Image into sql server or inside the folder name Images in web application

查看:78
本文介绍了将图像保存到sql server或文件夹名称中.Web应用程序中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个保存按钮,当按下单击下面的代码时,会将图像从相机保存到桌面上.....



I have one save button which will save the image in the desktop from camera when button is click below is the code.....

<input id="Save" style="Z-INDEX: 1; LEFT: 8px; WIDTH: 128px; TOP: 36px; HEIGHT: 24px"
                                             önclick="return save_onclick()" type="button" value="Save Image" name="save">


function save_onclick()
    {
        document.AxuEyeCam.SaveImage("test.jpg");       
    }





将图像保存在一台电脑上并不好,因为图像无法在全球范围内使用,它将可用仅适用于有图像的电脑。



我认为在sql server中使用mappath或存储图像在Web应用程序中保存图像,或者可能在云中图片将在全球范围内供应。



有谁能告诉我这是怎么回事。



非常感谢



It not good to save image in one pc because the image will not be available worldwide, it will be available for only to the pc which has image.

what i think is to save image in web application using mappath or store image in sql server or may be in cloud so that image will be available worldwide.

Can anybody suggest me how this is possible.

Thanks a lot

推荐答案

在ASP.Net中,您将使用AjaxControlToolkit中的FileUpload控件。这将允许用户将文件发送到您的网络服务器,然后您可以将其保存在您想要的任何位置。我建议将图像保存到图像文件夹中,然后在SQl数据库中保存它的路径。



或者,您可以使用已经存在的api。我相信你可以google在云端进行图像存储并找到其他一些选项。
In ASP.Net you would use a FileUpload control that is in the AjaxControlToolkit. That will allow the user to send the file to your webserver and then you can save it wherever you want at that point. I would recommend saving the image into an images folder and then save the path to it in your SQl database.

Or, you can use apis that are already out there. I am sure you could google for image storage in the cloud and find some other options.


检查这个

使用ASP.NET监视数据库或文件系统中的上传文件 [ ^ ](这有比较文件系统与数据库 - 优点/缺点等),



编辑

------------

使用 WebClient [ ^ ]
Check this
Storing Uploaded Files in a Database or in the File System with ASP.NET[^](This has comparison File System vs Database - Advantages/Disadvantages, etc.,)

EDIT
------------
Use WebClient[^]


使用asp.net上传控件将文件保存在文件夹中



Using asp.net upload control to save file in a folder

If UploadHeaderBanner.HasFile Then

                   Dim AttributesReadOnly = File.GetAttributes(Server.MapPath("~/images/header_banner.jpg"))
                   If AttributesReadOnly = FileAttributes.ReadOnly + FileAttributes.Archive Then
                       File.SetAttributes(Server.MapPath("~/images/header_banner.jpg"), IO.FileAttributes.Normal)
                   End If

                   FileExtension = UploadLoginImage.FileName
                   UploadHeaderBanner.SaveAs(Server.MapPath("~/images/header_banner.jpg"))
                   File.SetAttributes(Server.MapPath("~/images/header_banner.jpg), IO.FileAttributes.ReadOnly + FileAttributes.Archive)

               End If


这篇关于将图像保存到sql server或文件夹名称中.Web应用程序中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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