图片上传服务器方法: base64 flash iframe
<iframe id="upload_target" name="upload_target" src="upload.php" style="0;heigth:0;overflow:hidden;border:0;position: absolute; left:-500px;"></iframe> //iframe设置成隐藏的,src链接的页面为图片上传的后台文件页面,不过加不加影响都不大,只不过为了更精确而已 <img id="tag_img" src="" /> <form enctype="multipart/form-data" action="upload.php" method="post" target="upload_target"> <input type="file" name="userfile" class="file" value="" /> <input type="submit" name="uploadimg" value="上传" /> </form> //表单的那么值对应着空框架的那么值,提交后跳转到空框架中,这样就不对父窗口页面进行刷新了
<pre name="code" class="html">echo "<script type='text/javascript'>window.parent.document.getElementByIdx_x('tag_img').setAttribute('src','$updurl');</script>"; //这就是在框架中输出一段js代码,然后操作父框架中图片地址刷新成我上传的图片地址,$updurl为上传图片的地址