Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $sendTo = 'https://ftp.emc.com/....?domain=XX&user=XXX&password=XXX';
- $localfile ="23.txt";
- $fp = fopen($localfile, 'r');
- // Create CURL Connection
- $ch = curl_init();
- //curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_USERPWD, "usr:passwd");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
- curl_setopt($ch, CURLOPT_FAILONERROR, true);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_URL, $sendTo);
- //curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- curl_setopt($ch, CURLOPT_UPLOAD, 1);
- curl_setopt($ch, CURLOPT_INFILE, $fp);
- curl_setopt($ch, CURLOPT_INFILESIZE, filesize($localfile));
- echo $ch;
- $m=curl_exec ($ch);
- echo "m $m<br>";
- $error_no = curl_errno($ch);
- echo "error_no $error_no<br>";
- curl_close ($ch);
- if ($error_no == 0) {
- $error = 'File uploaded succesfully.';
- } else {
- $error = 'File upload error.';
- }
- echo $error;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement