move_uploaded_file()无法移动上传的文件

时间:2016-08-27 10:28:32

标签: php

在我的php代码中,此方法move_uploaded_file()始终返回false并且移动上传文件失败!我只是检查变量值,它们没问题。

  • echo $ fileName - > /tmp/php7KMo5C.pdf
  • echo $ dest - >图像/图片/ s1aerj875k.pdf
  • var_dump(move_uploaded_file($ source,$ target1)) - >布尔(假)

这是我的代码behide。

for (NetworkAddress address : addresses) {
    if (isConnectedTo(address)) {
        continue;
    }
    try {
        SocketChannel channel = SocketChannel.open();
        channel.configureBlocking(false);
        channel.connect(new InetSocketAddress(address.toInetAddress(), address.getPort()));
        // admittedly, 20 seconds is quite long
        long timeout = System.currentTimeMillis() + 20_000;
        while (!channel.finishConnect() && System.currentTimeMillis() < timeout) {
            // Without this loop, I get said exception
        }
        if (!channel.finishConnect()) {
            channel.close();
            continue;
        }
        ConnectionInfo connection = new ConnectionInfo(ctx, CLIENT,
            address,
            listener,
            requestedObjects, 0
        );
        connections.put(
            connection,
            channel.register(selector, OP_READ | OP_WRITE, connection)
        );
    } catch (NoRouteToHostException | AsynchronousCloseException ignore) {
    } catch (IOException e) {
        LOG.error(e.getMessage(), e);
    }
}

我还在文件夹上设置了777权限

0 个答案:

没有答案