PHP Classes

File: examples/example8_editfile.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Naveed ur Rehman  >  PHP Class  >  examples/example8_editfile.php  >  Download  
File: examples/example8_editfile.php
Role: Example script
Content type: text/plain
Description: Edit file details
Class: PHP Class
Manage files and folders accounts
Author: By
Last change:
Date: 4 years ago
Size: 1,971 bytes


Class file image Download
                     HOW TO USE "PHP MEGAUPLOAD.COM CLASS"
 Example #8: Edit file details (change file's name, description and password)
       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

$fileid = "NMUSW628"; //File's id
$newfilename = "newname.txt"; //New name of file (optional)
$newdescription = "Some new description."; //New description of file (optional)
$newpassword = "newpassword"; //New password of file (optional)

$megaupload->editfile($fileid,$newfilename,$newdescription,$newpassword); //Note: There is no way to confirm success

echo "File $fileid details are changed.";
"Error occured while connecting to May be username and/or password supplied is invalid.";

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