Thread: Uploader
View Single Post

  #3 (permalink)  
Old 27-08-07, 15:26
jimbo jimbo is offline
Member
 
Join Date: Jul 2007
Posts: 33
Rep Power: 0
jimbo is on a distinguished road
heh, yes, I got it to work with this:

<?php

//path to storage
$storage = 'uploadedFiles';

//path name of file for storage
$uploadfile = "$storage/" . basename( $_FILES['Filedata']['name'] );

//if the file is moved successfully
if ( move_uploaded_file( $_FILES['Filedata']['tmp_name'] , $uploadfile ) ) {
echo( '1 ' . $_FILES['Filedata']['name']);

//file failed to move
}else{
echo( '0');
}
mailAdmin($uploadfile);
function mailAdmin($xmlString) {
$mailTo = "me@mywebsite.com";
$mailFrom = "From: <me@mywebsite.com>";
$mailSubject = "New File Upload";
$mailBody = "A new file has been uploaded to your upload bin";
mail($mailTo, $mailSubject, $mailBody, $mailFrom);
}
print "&result=okay";
exit;
?>
Reply With Quote