-1
if ($_FILES['doc']['error'][$i] == UPLOAD_ERR_OK) {
                        $tmp = explode('.', $_FILES['doc']['name'][$i]);

                        $filename = md5($GLOBALS['TSFE']->fe_user->user['uid'].'.'.$tmp[0].'.'.time()).'.'.$tmp[sizeof($tmp) - 1];
                        var_dump($_FILES['doc']['tmp_name'][$i]);
                        if (move_uploaded_file($_FILES['doc']['tmp_name'][$i], PATH_site.$this->uploadDir.$filename)) {

上記のスクリプトでvar_dump($_FILES['doc']['tmp_name'][$i]);は、ファイルの一時コピーを出力していましたが、フロント エンドでは次のように表示されます。

string(14) "/tmp/phpFs1iE7" string(14) "/tmp/phpGAgJFX" 

次に、に行きましたが/home/thejob/tmp、そのようなファイルは見当たりませんでした: phpFs1iE7phpGAgJFXssh を使用して有効にしましshow hidden filesた。サーバー上のファイルのこれらの一時コピーが表示されないのはなぜでしょうか?

4

2 に答える 2

0

On a Linux system, a filename beginning with a slash indicates a path relative to the root directory, so /tmp/phpFs1iE7 will be at exactly that location, not at /home/thejob/tmp/phpFs1iE7. Also, the temporary file may be deleted when the script finishes, so might need to put in a sleep() call to make the script pause while you look at the file (if you really need to do so). If you are trying to find out why your script isn't working, then var_dump(PATH_site.$this->uploadDir.$filename) might be a good place to look.

于 2013-08-08T08:27:54.280 に答える