doushenyu2537 2016-06-19 02:22
浏览 71

获取文件位置和名称文件

i want to getting file name and path, then it writed on textboy this is what i already tried

<html>
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <input placeholder="path" type="text" name="path" tabindex="2" required>
    <input type="file" name="browse" value="browse">
    <input type="submit" name="convert" value="convert">
        <?php if(isset($_POST['browse'])){
            $path=$_POST['abc'];
        }
        ?>

</body>

  • 写回答

1条回答 默认 最新

  • doulao2029 2016-06-19 03:32
    关注

    If I understand your question correctly, then you need to use $_FILES.

    $_FILES['browse']['tmp_name'] will give you the temporary storage name of the file that was uploaded. This array also has another key $_FILES['browse']['name'] that returns just the file name of the file uploaded.

    You will need to create a script on your own that takes the temporary file from $_FILES['browse']['tmp_name'] and save it into a more permanent directory like /home/user/public_html/uploads/*, once you do that, you should know the upload path I hope.

    http://php.net/manual/en/reserved.variables.files.php

    评论

报告相同问题?

悬赏问题

  • ¥20 Keil编译时报错"no source": Error: #5: cannot open source
  • ¥50 操作系统时间无法更新
  • ¥20 Windows11, usb转hdmi,外接显示器无反应
  • ¥20 怎么在JavaFx的TableView中动态地添加数据。
  • ¥15 MFC里的工具栏按钮图标使用外部图片
  • ¥15 如何在 llama.cpp 服务器中实现用户登录功能的优化方案?(语言-c++)
  • ¥15 有会用octave 的吗,急!代做!好偿!
  • ¥15 有一套同城小程序源码,Uniapp前端,php+html+mysql后端 ,能不能教我搭建起来可以运行,我不知道怎样操作
  • ¥15 mac调用java.io接口无法在根目录生成文件
  • ¥15 java微服务节点假死,网关路由时长延迟