Joe,

> On Apr 23, 2020, at 1:41 PM, Joe Dombroski via 4D_Tech <[email protected]> 
> wrote:
> 
> I have been having occasional -43 protocol not supported errors when I
> attach files to an email. I finally dug in and found that I must keep the
> file name under 29 characters.  Anyone else notice this? I am on 16.4r4.


That has been around a while.  You also have to worry about the ‘.b64’ added at 
the end.  Here’s how I handle it.

                                $err:=IT_Encode 
($AttachmentArrayPtr->{$x};vEncodedAttachment;$EncodingNumber)  //<<  Encode 
the file here  3/6/07
                                  //
                                If (($Err=-37) | ($Err=-1411) | ($Err=10083))  
// File name too long  9/30/11
                                          //
                                        $Path:=""  // 5/17/10
                                        $FileName:=$AttachmentArrayPtr->{$x}  
// 5/17/10
                                        $Extension:=""  // 5/17/10
                                          //
                                        Repeat   // 5/17/10
                                                $y:=Position(Folder 
separator;$FileName)  // 2/22/19
                                                If ($y#0)  // 5/17/10
                                                        
$Path:=$Path+Substring($FileName;1;$y)  // 5/17/10
                                                        
$FileName:=Substring($FileName;$y+1)  // 5/17/10
                                                End if   // 5/17/10
                                        Until ($y=0)  // 5/17/10
                                          //
                                        $y:=Length($FileName)  // 5/17/10
                                        While ($y>=2)  // 5/17/10
                                                If 
(Substring($FileName;$y;1)=".")  // Found dot  5/17/10
                                                        
$Extension:=Substring($FileName;$y)  // 5/17/10
                                                        
$FileName:=Substring($FileName;1;$y-1)  // 5/17/10
                                                        $y:=0  // 5/17/10
                                                Else   // 5/17/10
                                                        $y:=$y-1  // 5/17/10
                                                End if   // 5/17/10
                                        End while   // 5/17/10
                                          //
                                        $FileName:=Substring($FileName;1;22)  
// Can olnly have 22 characters in file name to leave room for encoded file 
extension  5/17/10
                                        $ShortName:=$Path+$FileName+$Extension  
// 5/17/10
                                          //
                                        If (Test path name($ShortName)=1)  // 
Document already exists  5/13/09
                                                DELETE DOCUMENT($ShortName)  // 
Delete document  5/13/09
                                        End if   // 5/13/09
                                          //
                                        MOVE 
DOCUMENT($AttachmentArrayPtr->{$x};$ShortName)  // Make name smaller  10/2/08
                                        $AttachmentArrayPtr->{$x}:=$ShortName  
// 10/2/08
                                          //
                                        $err:=IT_Encode 
($AttachmentArrayPtr->{$x};vEncodedAttachment;$EncodingNumber)  // Re-encode 
the file  10/2/08
                                          //
                                        DELETE DOCUMENT($ShortName)  // Delete 
document  6/20/11
                                          //
                                End if   // 10/2/08
                                 

Randy Kaempen
Intellex Corporation

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to