PHP Classes

File: examples/example2_refreshlist.php

Recommend this page to a friend!
  Classes of Naveed ur Rehman  >  PHP Class  >  examples/example2_refreshlist.php  >  Download  
File: examples/example2_refreshlist.php
Role: Example script
Content type: text/plain
Description: To get list of files and folders (of root or sub-folder)
Class: PHP Class
Manage files and folders accounts
Author: By
Last change:
Date: 11 years ago
Size: 1,991 bytes


Class file image Download
                     HOW TO USE "PHP MEGAUPLOAD.COM CLASS"
 Example #2: To get list of files and folders (of root or sub-folder)
       Author: Naveed-ur-Rehman

require_once('../class/megaupload.class.php'); //php class file
require_once('credentials.php'); //Your signing in credentails of account

$megaupload = new megaupload_class(); //Initializing the class

$megaupload->username=$username; //Setting credentails (loaded from credentails.php)

$isconnect = $megaupload->connect(); //Return: 0=trouble, 1=validated and connected

"Credentials are verified and you are connected to successfully!<br/>";

//Note: See example2_refreshlist.php for getting file and folder IDs

$offolder = ""; //Blank for root otherwise mention folder id

$list = $megaupload->refreshlist(
$megaupload->FILES_MAXCOUNT, //or you may place some number
$megaupload->FILETYPE_ALL, //See Appendix-A
$megaupload->SORT_NAME, //See Appendix-B
$megaupload->ORDER_ASC, //See Appendix-C

$list = $megaupload->getlist(); //This holds the last refreshlist() response

echo "<pre>";
"Error occured while connecting to May be username and/or password supplied is invalid.";

$megaupload->disconnect(); //Disconnect to release everything