I need a form to accept Microsoft Word documents, Rich Text, or plain-text files within php-
My code looks like this:
if ("application/msword" == $uploadedfile_type) {
$extension = ".doc";
}
if ("application/rtf" == $uploadedfile_type) {
$extension = ".rtf";
}
else {
$extension = ".txt";
}
if ($uploadedfile_type == "text/plain"
or $uploadedfile_type =="application/rtf"
or $uploadedfile_type == "application/msword"
// HANDLE THE FILE
{
// Copy the file
if (is_uploaded_file($uploadedfile)) {
$filename = "./admin/attach/" . time() . $REMOTEHOST . $extension;
copy($uploadedfile, $filename);
echo ("File sucessfully saved as $filename"
}
else {echo ("No attachment file saved."
}
I had it all working with word docs and .txt files until I tried to add Rich Text-
Any help would be appreciated!
-TIA
--Allen
My code looks like this:
if ("application/msword" == $uploadedfile_type) {
$extension = ".doc";
}
if ("application/rtf" == $uploadedfile_type) {
$extension = ".rtf";
}
else {
$extension = ".txt";
}
if ($uploadedfile_type == "text/plain"
or $uploadedfile_type =="application/rtf"
or $uploadedfile_type == "application/msword"
// HANDLE THE FILE
{
// Copy the file
if (is_uploaded_file($uploadedfile)) {
$filename = "./admin/attach/" . time() . $REMOTEHOST . $extension;
copy($uploadedfile, $filename);
echo ("File sucessfully saved as $filename"
}
else {echo ("No attachment file saved."
}
I had it all working with word docs and .txt files until I tried to add Rich Text-
Any help would be appreciated!
-TIA
--Allen