Login   Register  
PHP Classes
elePHPant
Icontem

File: exampleUpload.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of leonardo ramos  >  Transmission of file  >  exampleUpload.php  >  Download  
File: exampleUpload.php
Role: Example script
Content type: text/plain
Description: upload example
Class: Transmission of file
Get and send files from SSH, FTP and HTTP servers
Author: By
Last change:
Date: 2009-07-06 05:08
Size: 595 bytes
 

Contents

Class file image Download
<?php
/*
 * SSH2 UPLOAD
 */

include('Upload.class.php');

$upload = new Upload("SSH2");

$upload->setConnection("files/Filetest.txt",'192.100.1.1'"/var/www/dir/dir2/test.txt","user","password","");

/*
 * Building rules by determining the maximum size limit and file types to upload
 */
$acceptedTypes = array("txt","doc","rtf");
$size 102400;//100KB
if(!$upload->fileCheck("files/Filetest.txt.txt",$size,$acceptedTypes)) {    
    echo 
$upload->getExceptions();    
}
else {
    
    if(
$upload->start("MOVE")) {
        echo 
"Upload OK!";
    } else {
        echo 
"Upload ERROR!";
    }
}

?>