Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-26-2008, 08:59 PM
HaBarbadi is offline HaBarbadi
Registered User

Join Date: Oct 2008
Location: Florida
Posts: 2

Confused can remove spaces from attachment name?

How would you remove the spaces from each attachment name? I think I found a little glitch in the Thunderbird email client, when an attachment arrives with spaces in the name, everything after the first space is dropped off, including the ext.
Thanks!
Reply With Quote
  #2  
Old 10-27-2008, 11:17 AM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
yah I can help you later on today
__________________
Reply With Quote
  #3  
Old 10-27-2008, 03:40 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Try this:
Find line 158
Replace:
Code:
function phattach($file,$name) {
	global $boundary;
	
	$fp=@fopen($file,"r");
	$str=@fread($fp, filesize($file));
	$str=@chunk_split(base64_encode($str));
	$message="--".$boundary."\n";
	$message.="Content-Type: application/octet-stream; name=\"".$name."\"\n";
	//$message.="Content-disposition: attachment\n"; Thanks goes to someone named Chris (I think, it was awhile ago) for his fix below!
	$message.="Content-disposition: attachment; filename=\"".$name."\"\n"; 
	$message.="Content-Transfer-Encoding: base64\n";
	$message.="\n";
	$message.="$str\n";
	$message.="\n";

	return $message;
}


With:
Code:
function phattach($file,$name) {
	global $boundary;
	
	$fp=@fopen($file,"r");
	$str=@fread($fp, filesize($file));
	$str=@chunk_split(base64_encode($str));
	$message="--".$boundary."\n";
	$message.="Content-Type: application/octet-stream; name=\"".str_replace(' ', "",$name)."\"\n";
	//$message.="Content-disposition: attachment\n"; Thanks goes to someone named Chris (I think, it was awhile ago) for his fix below!
	$message.="Content-disposition: attachment; filename=\"".str_replace(' ', "",$name)."\"\n"; 
	$message.="Content-Transfer-Encoding: base64\n";
	$message.="\n";
	$message.="$str\n";
	$message.="\n";

	return $message;
}
__________________
Reply With Quote
  #4  
Old 10-29-2008, 06:37 AM
HaBarbadi is offline HaBarbadi
Registered User

Join Date: Oct 2008
Location: Florida
Posts: 2

Thanks Atholon! That works fine....

If($attachment) {
$message .= "--MIME_BOUNDRY\n";

$message.="Content-Type: application/octet-stream; name=\"".str_replace(' ', "",$_FILES['attachment']['name'])."\"\n";
$message.="Content-disposition: attachment; filename=\"".str_replace(' ', "",$_FILES['attachment']['name'])."\"\n";
$message.="Content-Transfer-Encoding: base64\n";

$message .= "\n";
$message .= "$str\n";
$message .= "\n";
$message .= "--MIME_BOUNDRY--\n";
}
Reply With Quote
  #5  
Old 10-29-2008, 02:40 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
no prob
__________________
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
attachment / Attaches bigjoe11a Delta Force 0 02-13-2009 07:46 PM
Empty attachment ChB phphq.Net Forums 1 02-16-2006 02:10 PM
More attachment fields? DonetsS phphq.Net Forums 8 10-31-2005 03:48 PM
attachment again... Guest phphq.Net Forums 0 07-18-2005 02:49 AM
phMailer attachment Fallu phphq.Net Forums 3 12-25-2004 01:09 AM


All times are GMT -5. The time now is 11:33 AM.




Powered by vBulletin®