在laravel中上传文件时移动功能出错

时间:2016-02-21 10:03:18

标签: php laravel-5.1

 public String testMysqlCall() throws Exception {
            try {
                return gopuJdbcTemplate.query("select id from gopu limit 5", new IdMapper());
            } catch( Exception e) {
                throw e;
            }
        }

    private class IdMapper implements ResultSetExtractor<String> {
        public String extractData(ResultSet resultSet) throws SQLException {
            String toReturn=null;
            while(resultSet.next()) {
                toReturn = resultSet.getString("id");

            }
            return toReturn;
        }
    }

如果没有循环并且使用单个对象,此代码工作文件但是当我在循环中使用此代码时,foreach($messages as $singleMsg) { if ($uploadedFile) { $selectedMessageReply = MessageReply::where('msg_id', $singleMsg)->first(); $selectedMessageReply->is_attachment = 1; $selectedMessageReply->save(); $extension = $uploadedFile->getClientOriginalExtension(); $uploadedFile->move($pathToFile.$singleMsg, $selectedMessageReply->id . '.' . $extension); } } 函数给出move,那么问题是什么以及如何修复它? / p>

0 个答案:

没有答案