<small id='DyjdK'></small><noframes id='DyjdK'>

<legend id='DyjdK'><style id='DyjdK'><dir id='DyjdK'><q id='DyjdK'></q></dir></style></legend>

  1. <i id='DyjdK'><tr id='DyjdK'><dt id='DyjdK'><q id='DyjdK'><span id='DyjdK'><b id='DyjdK'><form id='DyjdK'><ins id='DyjdK'></ins><ul id='DyjdK'></ul><sub id='DyjdK'></sub></form><legend id='DyjdK'></legend><bdo id='DyjdK'><pre id='DyjdK'><center id='DyjdK'></center></pre></bdo></b><th id='DyjdK'></th></span></q></dt></tr></i><div id='DyjdK'><tfoot id='DyjdK'></tfoot><dl id='DyjdK'><fieldset id='DyjdK'></fieldset></dl></div>
    <tfoot id='DyjdK'></tfoot>

    • <bdo id='DyjdK'></bdo><ul id='DyjdK'></ul>

    1. PHP 错误 - 上传文件

      PHP Error - Uploading a file(PHP 错误 - 上传文件)
        <legend id='wQuI9'><style id='wQuI9'><dir id='wQuI9'><q id='wQuI9'></q></dir></style></legend>
        <i id='wQuI9'><tr id='wQuI9'><dt id='wQuI9'><q id='wQuI9'><span id='wQuI9'><b id='wQuI9'><form id='wQuI9'><ins id='wQuI9'></ins><ul id='wQuI9'></ul><sub id='wQuI9'></sub></form><legend id='wQuI9'></legend><bdo id='wQuI9'><pre id='wQuI9'><center id='wQuI9'></center></pre></bdo></b><th id='wQuI9'></th></span></q></dt></tr></i><div id='wQuI9'><tfoot id='wQuI9'></tfoot><dl id='wQuI9'><fieldset id='wQuI9'></fieldset></dl></div>

        • <bdo id='wQuI9'></bdo><ul id='wQuI9'></ul>

          <small id='wQuI9'></small><noframes id='wQuI9'>

                <tbody id='wQuI9'></tbody>
            • <tfoot id='wQuI9'></tfoot>

                本文介绍了PHP 错误 - 上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试编写一些 PHP 来将文件上传到我的网络服务器上的文件夹.这是我所拥有的:

                I'm trying to write some PHP to upload a file to a folder on my webserver. Here's what I have:

                <?php
                    if ( !empty($_FILES['file']['tmp_name']) ) {
                        move_uploaded_file($_FILES['file']['tmp_name'], './' . $_FILES['file']['name']);
                        header('Location: http://www.mywebsite.com/dump/');
                        exit;
                    }
                ?>
                
                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
                    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
                <html>
                    <head>
                        <title>Dump Upload</title>
                    </head>
                    <body>
                        <h1>Upload a File</h1>
                        <form action="upload.php" enctype="multipart/form-data" method="post">
                            <input type="hidden" name="MAX_FILE_SIZE" value="1000000000" />
                            Select the File:<br /><input type="file" name="file" /><br />
                            <input type="submit" value="Upload" />
                        </form>
                    </body>
                </html>
                

                我收到以下错误:

                警告:move_uploaded_file(./test.txt) [function.move-uploaded-file]:无法打开流:E:inetpubvhostsmywebsite.comhttpdocsdumpupload.php 中的权限被拒绝第 3 行

                Warning: move_uploaded_file(./test.txt) [function.move-uploaded-file]: failed to open stream: Permission denied in E:inetpubvhostsmywebsite.comhttpdocsdumpupload.php on line 3

                警告:move_uploaded_file() [function.move-uploaded-file]:无法将 'C:WINDOWSTempphpA30E.tmp' 移动到 E:inetpubvhostsmywebsite 中的 './test.txt'.comhttpdocsdumpupload.php 在第 3 行

                Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:WINDOWSTempphpA30E.tmp' to './test.txt' in E:inetpubvhostsmywebsite.comhttpdocsdumpupload.php on line 3

                警告:无法修改标头信息 - 标头已由 E:inetpubvhostsmywebsite.com 中的(输出开始于 E:inetpubvhostsmywebsite.comhttpdocsdumpupload.php:3)发送httpdocsdumpupload.php 在第 4 行

                Warning: Cannot modify header information - headers already sent by (output started at E:inetpubvhostsmywebsite.comhttpdocsdumpupload.php:3) in E:inetpubvhostsmywebsite.comhttpdocsdumpupload.php on line 4

                PHP 版本 4.4.7在 Windows 机器上运行 IIS.这个特定的文件/文件夹有 777 个权限.

                PHP version 4.4.7 Running IIS on a Windows box. This particular file/folder has 777 permissions.

                有什么想法吗?

                推荐答案

                因为是Windows,所以没有真正的777.如果你使用的是chmod,查看Windows相关的注释.

                As it's Windows, there is no real 777. If you're using chmod, check the Windows-related comments.

                检查 IIS 帐户是否可以访问(读取、写入、修改)这两个文件夹:

                Check that the IIS Account can access (read, write, modify) these two folders:

                E:inetpubvhostsmywebsite.comhttpdocsdump
                C:WINDOWSTemp
                

                这篇关于PHP 错误 - 上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                PHP Upload File Validation(PHP 上传文件验证)
                How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)
                php Unique filename when uploading(php 上传时唯一的文件名)
              1. <small id='Uh4YA'></small><noframes id='Uh4YA'>

                  <i id='Uh4YA'><tr id='Uh4YA'><dt id='Uh4YA'><q id='Uh4YA'><span id='Uh4YA'><b id='Uh4YA'><form id='Uh4YA'><ins id='Uh4YA'></ins><ul id='Uh4YA'></ul><sub id='Uh4YA'></sub></form><legend id='Uh4YA'></legend><bdo id='Uh4YA'><pre id='Uh4YA'><center id='Uh4YA'></center></pre></bdo></b><th id='Uh4YA'></th></span></q></dt></tr></i><div id='Uh4YA'><tfoot id='Uh4YA'></tfoot><dl id='Uh4YA'><fieldset id='Uh4YA'></fieldset></dl></div>

                    <tbody id='Uh4YA'></tbody>

                    <bdo id='Uh4YA'></bdo><ul id='Uh4YA'></ul>

                      <legend id='Uh4YA'><style id='Uh4YA'><dir id='Uh4YA'><q id='Uh4YA'></q></dir></style></legend>

                        <tfoot id='Uh4YA'></tfoot>