使用javascript上传,查看和删除图像 [英] Upload, view and delete images using javascript

查看:71
本文介绍了使用javascript上传,查看和删除图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp.net解决方案,它包含一个带有几个图像的图像文件夹。我需要创建一个弹出窗口来查看,上传,删除此文件夹中的图像。我不想使用任何html文件所有这些应该在一个js javascript文件中完成



我尝试过:



window.addEventListener('click',function(evt){

if(evt.detail === 2){

var myWindow = window.open(,MsgWindow,width = 400,height = 400);

myWindow.document.write();

}

});

I have a asp.net solution which consist of an image folder with a couple of images. I need to create a pop up to view, upload, delete the images in this folder. I dont want to use any html file all these should be done in a js javascript file

What I have tried:

window.addEventListener('click', function (evt) {
if (evt.detail === 2) {
var myWindow = window.open("", "MsgWindow", "width=400, height=400");
myWindow.document.write("");
}
});

推荐答案

你不能用javascript或jquery做这个,因为这些语言是为了运行而设计的在客户端。要上传文件,您需要对服务器文件系统的写访问权。因此,您需要一种服务器端语言,如PHP,CGI等。
You can't do this with javascript or jquery, because these languages are designed to run on client side. To upload a file you need write access to the server's filesystem. Therefore you need a server-side language like PHP, CGI and so on.


这篇关于使用javascript上传,查看和删除图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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