不止一次使用move_uploaded_file [英] use move_uploaded_file more than once

查看:175
本文介绍了不止一次使用move_uploaded_file的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的代码上调用了move_uploaded_file两次,但似乎第二个不起作用。



如果我交换它们的位置,



然后第一个会工作,但第二个不会。



任何建议吗?

解决方案

你不能移动文件两次。也许你正在寻找 copy()。当您移动文件时,原文不再存在。



文档: http:/ /php.net/copy
$ b 您可以使用 move_uploaded_file 并从那里复制文件


I call the move_uploaded_file on my code twice but seems that the second one doesn't work.

If I interchange the position of them,

then first one will works, but the second won't.

any suggestion?

解决方案

You can't move a file twice. Perhaps you are looking for copy(). When you move the file, the original doesn't exists anymore.

Docs: http://php.net/copy

You could use move_uploaded_file and copy the file from there again

这篇关于不止一次使用move_uploaded_file的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆