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