alvin553819

图片上传服务器的三种方法

图片上传服务器方法: base64  flash  iframe

<iframe id="upload_target" name="upload_target" src="upload.php" style="width: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为上传图片的地址  

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-08-26
  • 2021-12-30
  • 2022-01-02
  • 2021-10-25
  • 2022-12-23
猜你喜欢
  • 2021-12-04
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2022-01-07
  • 2021-06-05
  • 2022-12-23
相关资源
相似解决方案