通过javascript上传或移动图像到文件夹中

时间:2013-10-22 07:19:45

标签: javascript php

先谢谢 我正在使用下面的代码 我正在调用此函数onchange事件的浏览(输入类型=文件倍数=多个id = uploadimage) 我应该如何在tmp文件夹中上传图片,以便我可以在下面的代码中预览

function test (){
    var table = document.getElementById("rounded-corner1");
    var path  = "pz_serveroriginal/tmp/";
    var files = document.getElementById("uploadimage").files;
    table.innerHTML = "<tr><th>File Name</th><th>Image Preview</th><th>Delete</th></tr>";

    for (var i = 0; i < files.length; i++){ 
        table.innerHTML += "<tr>";
        table.innerHTML += "<td>"+ files[i].name +"</td>";
        table.innerHTML += "<td><a target=_blank href="+ path + files[i].name +" >"+ files[i].name +"<div id=somediv alt=your image ></div></a></td>";
        table.innerHTML += "<td><a href=# class=delbutton id=" + i + "><img title=Delete src=images/Delete.png ></a></td>";
        table.innerHTML += "</tr>";
        document.f2.image.src = files[i].name;
    }

}

0 个答案:

没有答案