以http方式发送文件(从服务器中的客户端存储上传)

发布于 2024-08-10 14:24:40 字数 190 浏览 3 评论 0原文

我正在寻找一种将多个文件从浏览器上传到服务器的解决方案。到目前为止,HTML 页面是用 oracle HTTP 工具包编写的(在 Windows NT 上使用 oracle mod_plsql)。

有人可以建议我解决从客户端上传文件并在服务器中处理它的解决方案吗?基于 HTML、Oracle HTTP、PHP 的解决方案都很好。非常感谢链接和建议。

I am looking for a solution to upload multiple files from browser to server. As of now the HTML pages are written in oracle HTTP toolkit (using oracle mod_plsql on Windows NT).

Can someone suggest me solution to upload files from client side and process it in server. Solutions based on HTML, Oracle HTTP, PHP are fine. Links and suggestions are greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

归途 2024-08-17 14:24:40

您可以使用类似的东西,但我建议添加更多验证。

<?php


switch ($_REQUEST['mode']

    case 'upload':

        $ourpath = "/ourfolder/uploads/";

        $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

        if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
            echo "You have uploaded".  basename( $_FILES['uploadedfile']['name']);
        } else{
            echo "There was an error uploading the file, please try again!";
        }

        break;

    default: 

    ?><form enctype="multipart/form-data" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
    Select a File: <input name="uploadedfile" type="file" /><br />
    <input type="hidden" name="mode" value="upload" />
    <input type="submit" value="Submit" />
    </form>

<?php

}

?>

You could use something like this, but I would suggest adding a lot more validation.

<?php


switch ($_REQUEST['mode']

    case 'upload':

        $ourpath = "/ourfolder/uploads/";

        $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

        if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
            echo "You have uploaded".  basename( $_FILES['uploadedfile']['name']);
        } else{
            echo "There was an error uploading the file, please try again!";
        }

        break;

    default: 

    ?><form enctype="multipart/form-data" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
    Select a File: <input name="uploadedfile" type="file" /><br />
    <input type="hidden" name="mode" value="upload" />
    <input type="submit" value="Submit" />
    </form>

<?php

}

?>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文