Uploadify是一個jQuery插件,允許輕鬆集成多(或單)在您的網站上傳文件。它需要Flash和任何後端開發語言。一組選項允許高級用戶完全自定義,但基本實現非常簡單,即使編碼新手也可以完成。有Uploadify電子郵件中的鏈接下載文件
我想問問,如果有可能發出剛剛上傳wioth Uploadify的電子郵件通知文件的鏈接。
這裏是uploadify.php代碼:
<?php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
// $fileTypes = str_replace('*.','',$_REQUEST['fileext']);
// $fileTypes = str_replace(';','|',$fileTypes);
// $typesArray = split('\|',$fileTypes);
// $fileParts = pathinfo($_FILES['Filedata']['name']);
// if (in_array($fileParts['extension'],$typesArray)) {
// Uncomment the following line if you want to make the directory if it doesn't exist
// mkdir(str_replace('//','/',$targetPath), 0755, true);
move_uploaded_file($tempFile,$targetFile);
echo "1";
// } else {
// echo 'Invalid file type.';
// }
}
//define the receiver of the email
$to = '[email protected]';
//define the subject of the email
$subject = 'Test email';
//define the message to be sent. Each line should be separated with \n
$message = "Hello World!\n\nThis is my first mail.";
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: [email protected]\r\nReply-To: [email protected]";
//send the email
$mail_sent = @mail($to, $subject, $message, $headers);
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "Mail sent" : "Mail failed";
?>
是的,但我該如何實現它我真的不擅長於PHP – 2010-04-12 20:30:18
對不起。我不打算爲您編寫完整的解決方案!我的提示應該指出你正確的方向! – timdev 2010-04-12 20:42:29
明白......謝謝 – 2010-04-13 14:42:47