Home >Backend Development >PHP Tutorial >二进制-html表单上传file,php获取然后保存到数据库中,类型blob

二进制-html表单上传file,php获取然后保存到数据库中,类型blob

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-02 11:33:312013browse

二进制php表单上传

<code><form action="../php/teest.php" method="post">        <input type="file" name="pic">            <input type="submit" value="提交">    </form>    php:    require_once('mysql_helper.php');$pic = $_POST['pic'];$path = './Users/e-bag4/Desktop'. $_FILES['pic']['name'];if (move_uploaded_file($_FILES['pic']['tmp_name'],$path)) { $sql="insert into e_user(pic)values('$path')";    if(execute_data($sql)){         echo "上传成功!!";    }else{        echo "文件上传失败!!";        }}    我想问一下我这代码中需要怎么改进一下</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn