如何更新type = file [英] how to update type=file

查看:81
本文介绍了如何更新type = file的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更新type = file

how to update type=file

这些行在我的更新文件中.这个作品.它呼应$ row,我可以更改它,也可以随它去.

These lines are in my update file. This one works. It echos the $row and i can change it or let it be.

<textarea  cols="25" rows="5" name="bio" ><?php echo $row['bio']?> </textarea> </tr></td>

现在我的问题是,我如何使用type ="file"来获得相同的效果?

Now my question is, how can i get the same thing work with an type="file" ?

<input type="file" name="img" accept="image/jpg,image/gif,image/png" /></tr></td>

推荐答案

由于浏览器安全性原因,您不能这样做.

You cannot do that due to browser security reasons.

但是您还可以做其他事情.

在文件上传字段下方显示上传的图片.如果用户要更改它,请让他上传另一张图片,否则将其留空.

Display the uploaded pic below the file upload field.If the user wants to change it , let him upload another pic or else just leave it blank.

在服务器端,只需检查该字段是否为空,然后执行必要的操作即可.

In the server-side just check if the field is blank or not and do the necessary action.

这篇关于如何更新type = file的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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