Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Question about perderabo's MIMETOOL script Post 68752 by Perderabo on Wednesday 6th of April 2005 05:05:34 PM
Old 04-06-2005
Mimetool won't work with control characters. Printable ascii only. Try this script and select binary mode to send the file. That might work. Transferring binary files between platforms is dicey though.
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Follow-up w/ Perderabo re: mimetool

This is a follow-up re: this thread As I mentioned, this script works very nicely, thanks again. However, the ASCII data of the 'attached file' also shows below the body of the email message. Do you know of a way to 'disable' the attached text from showing? Although the file is attached,... (3 Replies)
Discussion started by: jwperry
3 Replies

2. Shell Programming and Scripting

ksh syntax explanation - from mimetool

Hi I got this part of the script from the mimetool by Perderabo. I have difficulty in decyphering the syntax specially lines 4,5 & 9. Also the test condition in line 3. Could someone help me on this please. -------------------------------------- pwentry=$(grep "^$(logname):" /etc/paswd)... (2 Replies)
Discussion started by: chaandana
2 Replies

3. UNIX for Dummies Questions & Answers

Question to a Perderabo script

Hi I tried this date script https://www.unix.com/showthread.php?p=16559#post16559 but I am probably doing something wrong. If i type: datecalc -a 2006 05 01 + 5 I get following error message: datecalc: Syntax error at line 207 If i look at line 207 i dont get it! But thats not surprising. ... (2 Replies)
Discussion started by: swissman24
2 Replies

4. Post Here to Contact Site Administrators and Moderators

apologies to Perderabo

Sorry Perderabo, really was only asking advice on where best to post, and if I should post. Didn't intend for that missive to be posted. (0 Replies)
Discussion started by: keith.m
0 Replies

5. What is on Your Mind?

Perderabo: Is that a common handle?

In an web based turn-based-strategy game I play (which until I am sure of the rules of this section of the forum, I'll not post a link to but is tiny and involves wars, warz even ;)), there is a player called Perderabo who has become rather powerful by the looks of things... Could this be one and... (2 Replies)
Discussion started by: Smiling Dragon
2 Replies

6. Shell Programming and Scripting

[Solved] Question for Perderabo on date calc

Hi, First of all, thanks for all the awesome suggestions on this forum. This helps all the UNIX enthusiast like me. Now, I had a similar requirement as mentioned in a very old post here: Question about Perderabo's "Days Elapsed Between Two Dates" But I am struggling what to change in the... (5 Replies)
Discussion started by: CleoBos
5 Replies
FPASSTHRU(3)								 1							      FPASSTHRU(3)

fpassthru - Output all remaining data on a file pointer

SYNOPSIS
int fpassthru (resource $handle) DESCRIPTION
Reads to EOF on the given file pointer from the current position and writes the results to the output buffer. You may need to call rewind(3) to reset the file pointer to the beginning of the file if you have already written data to the file. If you just want to dump the contents of a file to the output buffer, without first modifying it or seeking to a particular offset, you may want to use the readfile(3), which saves you the fopen(3) call. PARAMETERS
o $handle -The file pointer must be valid, and must point to a file successfully opened by fopen(3) or fsockopen(3) (and not yet closed by fclose(3)). RETURN VALUES
If an error occurs, fpassthru(3) returns FALSE. Otherwise, fpassthru(3) returns the number of characters read from $handle and passed through to the output. EXAMPLES
Example #1 Using fpassthru(3) with binary files <?php // open the file in a binary mode $name = './img/ok.png'; $fp = fopen($name, 'rb'); // send the right headers header("Content-Type: image/png"); header("Content-Length: " . filesize($name)); // dump the picture and stop the script fpassthru($fp); exit; ?> NOTES
Note When using fpassthru(3) on a binary file on Windows systems, you should make sure to open the file in binary mode by appending a b to the mode used in the call to fopen(3). You are encouraged to use the b flag when dealing with binary files, even if your system does not require it, so that your scripts will be more portable. SEE ALSO
readfile(3), fopen(3), popen(3), fsockopen(3). PHP Documentation Group FPASSTHRU(3)
All times are GMT -4. The time now is 01:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy