如何在客户端将图像保存到server.mappath中

时间:2022-04-22 15:34:52

I have one button as below code

我有一个按钮,如下面的代码

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

the function for click event is as below

click事件的功能如下

<script language="javascript" id="clientEventHandlersJS">
function save_onclick()
{
   document.AxuEyeCam.SaveImage("test.jpg");       
}
</script>

By these way it is saving image in desktop folder of computer,

通过这种方式,它将图像保存在计算机的桌面文件夹中,

but i want to save image inside my web application folder name PatientImages, maybe using server.mappath(""); blau blau blau....so can anybody give me the code how it is possible to save image or some idea how it can be possible..

但我想在我的Web应用程序文件夹名称PatientImages中保存图像,也许使用server.mappath(“”); blau blau blau ....所以任何人都可以给我代码如何保存图像或一些想法如何可能..

thank you very much...

非常感谢你...

2 个解决方案

#1


1  

I don't think directly it is possible. You need to create a web-service for that and then use the service from jquery or java-script.

我不认为直接有可能。您需要为此创建Web服务,然后使用jquery或java-script中的服务。

Example:-
http://www.c-sharpcorner.com/uploadfile/scottlysle/uploadwithcsharpws05032007121259pm/uploadwithcsharpws.aspx

示例: - http://www.c-sharpcorner.com/uploadfile/scottlysle/uploadwithcsharpws05032007121259pm/uploadwithcsharpws.aspx

#2


0  

try something like this

尝试这样的事情

var strfilename = "test.jpg";
document.AxuEyeCam.SaveImage("<%= Server.MapPath("~/PatientImages/" + strfilename + "") %>");

#1


1  

I don't think directly it is possible. You need to create a web-service for that and then use the service from jquery or java-script.

我不认为直接有可能。您需要为此创建Web服务,然后使用jquery或java-script中的服务。

Example:-
http://www.c-sharpcorner.com/uploadfile/scottlysle/uploadwithcsharpws05032007121259pm/uploadwithcsharpws.aspx

示例: - http://www.c-sharpcorner.com/uploadfile/scottlysle/uploadwithcsharpws05032007121259pm/uploadwithcsharpws.aspx

#2


0  

try something like this

尝试这样的事情

var strfilename = "test.jpg";
document.AxuEyeCam.SaveImage("<%= Server.MapPath("~/PatientImages/" + strfilename + "") %>");