简体   繁体   English

使用php将同一映像一台服务器上传到另一台服务器

[英]Upload same Image one server to another server using php

I search this question in Stackoverflow but I don't understand the answer. 我在Stackoverflow中搜索此问题,但我不明白答案。 Sorry. 抱歉。

Well, I've a html upload form which handle by Php. 好吧,我有一个由Php处理的html上传表单。

Following is my php upload script : 以下是我的php上传脚本:

if($image["name"] != "")
{
//$path = PATH . DS . "uploads" . DS . "products" . DS . $id;
$path = "../../uploads" . DS . "products" . DS . $id;
if(!is_dir($path))
{
    mkdir($path);
}
chmod($path, 0755);
//move_uploaded_file($image["tmp_name"], $path . DS . $image["name"]);
move_uploaded_file($image["tmp_name"], $path . DS . $uploadImage);//exit;
}

Now I'm trying to upload same image to Another website folder. 现在,我试图将同一张图片上传到另一个网站文件夹。 Like : www.mysitename/folder/finalfolder. 像:www.mysitename / folder / finalfolder。 in the same time with Php. 与Php同时

Is there any way to upload it another website ? 有什么办法可以上传到另一个网站吗?

The other server will need a script to handle the request. 另一个服务器将需要一个脚本来处理请求。 You can then POST that data to the other server's script using a CURL request. 然后,您可以使用CURL请求将该数据发布到另一台服务器的脚本中。 (See the link posted by @Andrey Volk) (请参阅@Andrey Volk发布的链接)

Or, as suggested here: FTP will work too, if you have that level of access to the server. 或者,如此处建议的那样:如果您具有对服务器的访问级别,则FTP也将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM