0

私はこのようなフォルダ構造を持っています

public_html
     /images

outside
    /file_uploader.php

つまり、public_htmlwebroot フォルダーです。

outsidewebroot フォルダの外にあります。

だから、フォルダにファイルをアップロードしたい public_html/images

私はファイルにoutside/file_uploader.php このコードを持っています:

move_uploaded_file(
     $_FILES['img_name']['tmp_name'], 
     absolute/path/to/public_html/images/folder
);

しかし、これはエラー、そのUnable to access to public_html/imagesフォルダーを返します。

質問: からファイルをアップロードするにはどうすればよいoutside_of_webroot_fileですwebroot\folderか?

4

1 に答える 1

0
// see if you have permission to write to this folder
if(!is_writable(absolute/path/to/..)) {
    chmod()
}

move_uploaded_file()
于 2013-02-04T12:39:58.113 に答える