473,500 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FTP Upload from my server to other server

194 New Member
Hi everyone,

I have a VPS (Dedicated Server) where im hosting my website. I am creating zip file using PHP and size of that zip file can be huge like it can be 700mb or can be 1gb.

My requirement is to move that zip file from my web server to other web server. I am afraid that how i can upload such big files using php ftp and what type of restrictions php/apache impose on such type of big files transfers.

Simple thing to understand is this will be a transfer from one server to other server because it will be generated at my server and will be saved at my server first then it will be transferred to other server.

This type of file transfer is not using $_FILES as such max upload file size limit dont apply here (i guess).

Does linux wput command will work here for me? or should i use something else. I can't use desktop applicatons like cuteFTP Filezilla or something else to transfer file as i have to do it programatically using PHP.

So please guide me which way is best and how i can transfer such big files from one server to other server.

Thanking you.
Regards.
Jun 10 '11 #1
1 1797
Rekha Kumaran
30 New Member
<?php

$ftp_server = "HOSTNAME";
$ftp_user_name = "<username>";
$ftp_user_pass = "<password>";
$destination_file = "C:\\wamp\\www\\projects\\public_html\\upload_file \\".$_FILES['image']['name'];
$sourcefile = $_FILES['image']['name'];

// set up basic connection
$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// check connection
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
exit;
} else {
echo "Connected to $ftp_server, for user $ftp_user_name";
}

// upload the file
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // line 30

// check upload status
if (!$upload) {
echo "FTP upload has failed!";
} else {
echo "Uploaded $source_file to $ftp_server as $destination_file";
}

// close the FTP stream
ftp_close($conn_id);

?>
Jun 13 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
5053
by: garbagecatcher | last post by:
Hello, here's my problem: On my web server I generate a file, I need to send this file to a different web server. I have no control over the other web server. The only way they accept...
4
1782
by: Murugavel | last post by:
Hi, We maintain a seperate server for files which are uploaded by the user(Clients). We run our site in Production server,we need to Keep our uploaded files in our file server. we use...
1
1598
by: Murugavel | last post by:
Hi all, Now,we stored uploaded files into our webserver(where the place our site is running) by normal upload function ASP.NET ,but we brought a new server for keeping files. How Can we ...
2
9652
by: mt | last post by:
Is there a way to upload a file to a different server other than the one hosting the web app? I've tried using the following syntax: Request.Files.SaveAs("\\\\servername\\sharename\\directory" +...
2
1018
by: THY | last post by:
Hi, can anyone give me a sample of browse to select file, and then upload it to server ? thanks.
7
1200
by: TJS | last post by:
does asp.net have server to server file transfer (upload) capability ?
1
1781
by: paras | last post by:
I am using File Upload Control to upload file on server. If size of the file exceeds maxRequestLength property in httpRuntime section of my configuration file, then DNS error is thrown. how can i...
7
1668
by: rinkudhimar | last post by:
resize an image and upload it to server
3
2229
by: =?Utf-8?B?Sm9obiBT?= | last post by:
Hi, I'm trying to publish a new web service that I've written. It's fine when I publish it on the local PC but I get Publish failed in the development environment when I try to publish it to...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.