Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

uploading .rtf files to the web

Status
Not open for further replies.

RWCherry

Programmer
Aug 16, 2013
5
0
0
US
problem perl code: uploading .rtf files

$ppc='pphold/pp' . $cap;
open (DTION, ">","$ppc") or die "$!";
#binmode DTION;
while ($chunk=read ($cap, $data, 1024)) {
print DTION $data;
}
close DTION;

and I get this mess when displaying uploaded rtf file

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 Can we eat here
\par Pretty please mama\par }

the original rtf file uploaded looks like this:

Can we eat here<br />
Pretty please mama

perl particulars:

#!/usr/bin/perl -w
use CGI ':standard';
use DBI;
print "Content-type: text/html\n\n";
 
audio pro,

What code did you use to display both files?

 
I followed your links and both files worked as expected.
The 'mess' you referred to in your first post is the rtf file being displayed as a plain text file but why it works with some and not others for you is unclear.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top