Login   Register  
PHP Classes
elePHPant
Icontem

File: upload.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Evert Ulises German Soto  >  cURL Easy and Fast  >  upload.php  >  Download  
File: upload.php
Role: Example script
Content type: text/plain
Description: upload.php
Class: cURL Easy and Fast
Send HTTP request to remote servers using Curl
Author: By
Last change: the post fields are changed
Date: 1 year ago
Size: 652 bytes
 

Contents

Class file image Download
<?php
require("curl.class.php");

$fTmpName "";
$tmp_name "";

// Make sure a file has been selected for upload 
if(is_uploaded_file($_FILES['file_any']['tmp_name'])){
    
$fTmpName $_FILES['file_any']['tmp_name'];
    
$tmp_name "@".$fTmpName;
}else{
    die(
"No such file selected.");
}

$options = array(
    
"url" => "http://localhost/wArLeY_cURL/process_file.php",
    
"data" => "plain",
    
"post" => "1",
    
"return_transfer" => "1",
    
"post_fields" => "nombre=".$_POST["txt_name"]."&archivo=".$tmp_name),
    
"redirect" => "0"
);

$obj = new wArLeY_cURL($options);
$resp $obj->Execute();
//echo $obj->getError();

echo $resp;
?>