Truncate a file from the beginning

B

BG

Wanted: I'd like to cut of n-bytes from the start of the file.

Problem: I have a CGI Perl script that return a wav file from GET requests.
I don't know any better method to send wav file than just putting the it in
the body of the returned html page. The returned html page will then be
processed (by the client that sent GET request, which also is a Perl
script). So this html page is binary file with HTML (ascii) header. I need
to strip off the html header to be able to play the wav file.

Any helps would be appreciated.


BG
 
P

Paul Boardman

BG said:
Wanted: I'd like to cut of n-bytes from the start of the file.

Problem: I have a CGI Perl script that return a wav file from GET requests.
I don't know any better method to send wav file than just putting the it in
the body of the returned html page. The returned html page will then be
processed (by the client that sent GET request, which also is a Perl
script). So this html page is binary file with HTML (ascii) header. I need
to strip off the html header to be able to play the wav file.

Any helps would be appreciated.

Well, this really isn't a Perl problem. The problem is that you don't
understand how to send wav files over HTTP.

You need to send a different header than the usual text/html one. The
following page lists a common set of MIME types you might want to send:

http://www.galileo.edu/wp/presentation-html-download?presentation_id=193

The specific one you want is probably audio/x-wav.

Paul
 
B

BG

Hi

The correct mime type is audio/x-wav as you said. I tried with
HTTP::Request (GET ftp:// ...) and got it confirmed.
I got it working by (GET http:// .... ) now. Thanks.

BG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top