/******************************************************************************
* Copyright 1991-2011 by Quantum Corporation. All rights reserved.
* No part of this work may be reproduced or transmitted in any
* form or by any means, electronic or mechanical, including
* photocopying and recording, or by any information storage
* or retrieval system, except as may be expressly permitted by
* the 17 U.S.C. section 101, et. seq., or in writing by
* Quantum Corporation.
*******************************************************************************/
// Post forms to this to upload files. You can put this in a hidden iframe to
// do a sort of "background" upload which is useful for upload wizards where
// some action needs to be taken at the end. It takes two parameters:
// fileUpload: the file itself
// targetPath: the place to move the file to
//
// Upon completion, either "0" for success or "1" are printed to the output. No
// other output will occur.
if($_SERVER[REQUEST_METHOD] == "POST" && is_uploaded_file($_FILES['uploadFile']['tmp_name']))
{
if(isset($_POST["targetPath"]))
{
error_log("Moving file: ".$_FILES['uploadFile']['tmp_name']." -> ".$_POST["targetPath"]);
rename($_FILES['uploadFile']['tmp_name'], $_POST["targetPath"]);
}
error_log("Indicating successful upload");
echo '';
}
else
{
error_log("Indicating failed upload");
echo '';
}
?>