Multiple pdf attachments from server folder using SO_DOCUMENT_SEND_API1

Dears,
I am trying to build a program able to send an email with multiple pdf attachments.
The files are stored in a folder in SAP server.
I am able to generate a pdf file from a spool and sucessfully attach it to the email using:
CALL FUNCTION 'CONVERT_OTF_2_PDF'
      IMPORTING
        bin_filesize           = v_bin_filesize
      TABLES
        otf                    = job_output_info-otfdata
        doctab_archive         = it_docs
        lines                  = it_lines
      EXCEPTIONS
        err_conv_not_possible  = 1
        err_otf_mc_noendmarker = 2
        OTHERS                 = 3.
    IF sy-subrc = 0.
      LOOP AT it_lines.
        TRANSLATE it_lines USING ' ~'.
        CONCATENATE gd_buffer it_lines INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att_aux = gd_buffer.
        APPEND it_mess_att_aux.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDIF.
Internal table it_mess_att_aux is the parameter contents_bin of FM SO_DOCUMENT_SEND_API1.
I have now 2 files on a server folder which I would like to include as well.
I am reading the content of the pdf files in following way:
DATA:   gd_buffer                 TYPE string,
      OPEN DATASET lv_fileserver FOR INPUT IN BINARY MODE.
      IF sy-subrc <> 0.
        MESSAGE e257(zmsgsd) WITH lv_fileserver.
      ELSE.
        CLEAR: it_mess_att_aux[], gd_buffer.
        DO.
          READ DATASET lv_fileserver INTO gd_buffer.
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
          APPEND gd_buffer TO it_mess_att_aux.
        ENDDO.
        APPEND LINES OF it_mess_att_aux TO it_mess_att.
I do not understand the purpose of the statement:
        TRANSLATE it_lines USING ' ~'.
in this context. Could anyone explain it?
All the files are attached to email with the desired name but corrupted and with the wrong size.
Can anyone help me build the logic to attach a pdf file from server in a email?
Thank you in advance,
Kind Regards,
João Cabrita

hi , try this ,it is working fine  .
  DATA: i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
          i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
*          wa_doc_chng LIKE sodocchgi1,
          i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
*         i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
       i_objhead LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      i_tline TYPE TABLE OF tline WITH HEADER LINE,
      i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      wa_doc_chng LIKE sodocchgi1,
      v_lines_txt TYPE i,
       l_lines TYPE I VALUE '20'.
  CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
      format        = 'PDF'
      max_linewidth = 132
    IMPORTING
      bin_filesize  = bin_filesize
    TABLES
      otf           = int_tab_otf_final
      lines         = int_pdf_tab.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
*****************soc ranjan***************************
*  IF full_path IS INITIAL.
*    CALL METHOD cl_gui_frontend_services=>file_save_dialog
*      EXPORTING
**    WINDOW_TITLE         =
**           DEFAULT_EXTENSION    = 'PDF'
**    DEFAULT_FILE_NAME    =
*           file_filter          = 'Portable Document Format (.pdf)' " for restricting saving file only as pdf
*      CHANGING
*        filename             = file_name
*        path                 = file_path
*        fullpath             = full_path
*    IF sy-subrc <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
**            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*    ENDIF.
*  ENDIF.
******************eoc ranjan*****************
*break-point.
  CONCATENATE full_path git_select_option-pernr INTO path SEPARATED BY '_'.
  CONCATENATE path 'PDF' INTO path SEPARATED BY '.'.
**  **************************for downloading*********************************
*  CALL FUNCTION 'GUI_DOWNLOAD'
*    EXPORTING
*      bin_filesize = bin_filesize
*      filename     = path
*      filetype     = 'BIN'
*    IMPORTING
*      filelength   = file_size
*    TABLES
*      data_tab     = int_pdf_tab.
*  IF sy-subrc <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
**         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*  ENDIF.
  CLEAR : lop , el , sl , cl .
*  ******************addeddd later  by ranjan  21.04.2011
DATA : desc TYPE char40 ,
      desc1 TYPE char100 .
  CALL FUNCTION 'QCE1_CONVERT'
TABLES
t_source_tab = int_pdf_tab
t_target_tab = i_record
EXCEPTIONS
convert_not_possible = 1
OTHERS = 2.
IF sy-subrc <> 0.
WRITE : / 'Error in conversion of pdf lines'(015).
ENDIF.
APPEND LINES OF i_record TO i_objbin.
*Creation of the entry for the compressed attachment
DESCRIBE TABLE i_objbin LINES bin_filesize.
i_objtxt = 'Hi'.
APPEND i_objtxt.
i_objtxt = '                                     '.
APPEND i_objtxt.
i_objtxt = 'Pls  find  the attached  salary slip ' .
APPEND i_objtxt.
i_objtxt = '  '.
APPEND i_objtxt.
i_objtxt = '  '.
APPEND i_objtxt.
i_objtxt = '  '.
APPEND i_objtxt.
i_objtxt = '  '.
APPEND i_objtxt.
i_objtxt = '  '.
APPEND i_objtxt.
i_objtxt = '         '.
APPEND i_objtxt.
i_objtxt = '  '.
APPEND i_objtxt.
i_objtxt = '  '.
APPEND i_objtxt.
i_objtxt = '        '.
APPEND i_objtxt.
i_objtxt = '  '.
APPEND i_objtxt.
i_objtxt = '         '.
APPEND i_objtxt.
i_objtxt = '  '.
APPEND i_objtxt.
i_objtxt = '  '.
APPEND i_objtxt.
i_objtxt = '         '.
APPEND i_objtxt.
i_objtxt = '  '.
APPEND i_objtxt.
i_objtxt = 'Regards:  '.
APPEND i_objtxt.
i_objtxt = 'Corporate HR  '.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES L_LINES.
READ TABLE i_objtxt INDEX L_LINES.
wa_doc_chng-doc_size = ( L_LINES - 1 ) * 255 + STRLEN( i_objtxt ).
*Creating the entry for the compressed document
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = L_LINES.
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
***CLEAR:  i_objpack .
***i_objpack-transf_bin = ' '.
**i_objpack-head_start = 1.
**i_objpack-head_num = 0.
**i_objpack-body_start = 1.
**i_objpack-body_num = L_LINES.
**i_objpack-doc_type = 'TXT'.
**i_objpack-obj_descr = desc1 .
**APPEND i_objpack.
*CLEAR: i_objhead .
*i_objhead = DESC.
*APPEND i_objhead.
*break-point .
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = bin_filesize.
i_objpack-obj_name = 'Employee Payslip'.
i_objpack-obj_descr = 'Employee Payslip'.
i_objpack-doc_size = bin_filesize  * 255 .
i_objpack-doc_type = 'PDF'.
APPEND i_objpack.
CONCATENATE 'Salary Slip of Month' p_month INTO desc SEPARATED BY ' ' .
*DESCRIBE TABLE i_objtxt LINES v_lines_txt.
*READ TABLE i_objtxt INDEX v_lines_txt.
****wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 375 + STRLEN( i_objtxt ).
wa_doc_chng-obj_name = 'Payslip'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = desc.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
CLEAR i_objpack.
DATA: l_usrid_long TYPE pa0105-usrid_long.
DATA : emessage(70) TYPE c.
CLEAR : l_usrid_long.
SELECT SINGLE usrid_long
FROM pa0105
INTO l_usrid_long
WHERE pernr = git_pa0001-pernr
AND subty = '0010'.
*break-point.
IF sy-subrc EQ 0.
i_reclist-receiver = l_usrid_long.                     
i_reclist-rec_type = 'U'.
i_reclist-com_type = 'INT'.
APPEND i_reclist.
ELSE.
WRITE:/ 'No email id is maintained for this personnel number' , git_pa0001-pernr.
ENDIF.
IF NOT i_reclist[] IS INITIAL.
***************************************for senders id *************************************
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
  EXPORTING
    document_data                    = wa_doc_chng
  put_in_outbox = 'X'
   sender_address                   = 'xys'
   sender_address_type              = 'SMTP'
   commit_work                      = 'X'
* IMPORTING
*   SENT_TO_ALL                      =
*   NEW_OBJECT_ID                    =
*   SENDER_ID                        =
  TABLES
packing_list = i_objpack
object_header = i_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Similar Messages

  • How to print multiple PDF attachments from report

    Hello experts,
    I have developed an ALV report that is having some PDF attachments and I have push button(Print all) as shown in below image.
    When I click on print all button all the pdf attachments should be send to printer.
    I did check in the SCN but I found some posts to print single pdf from after opening the pdf and some posts to view a pdf file which is saved on desktop but in my requirement I have multiple pdf attachments and I have to send all the attachments to printer with print all button click without opening the attachmens.
    Can you please help me to resolve this issue.Thanks in advance.
    Thanks & Regards
    Suman

    Hi,
    Your Requirement is bit complex,
    i hope we can achieve the solution if follows bellow links and we use application server for temporary storage.
    Print Adobe Document from any URL link in SAP ABAP.
    Hope this will help you.

  • Is it possible to send multiple PDF attachments from an iPad?

    When sending an email from my iPad, I am unable to send multiple attachments, just one file at a time.
    Is there any way to send two PDF files in one email?
    Thanks,
    Melissa.

    I don't need to send it to multiple contacts, I need to send multiple PDF files in an email from my iPad.
    Thanks for the assistance though.
    Regards,
    Melissa.

  • Importing multiple jpeg files from local folder into database LOB column

    I have to programatically save multiple pictures (jpeg) from the folder on my PC into Oracle table LOB column. I have to be able to choose local folder on my PC where are the pictures, and press button on Oracle Forms to save pictures in LOB column in database.
    I'm using Forms 6i and Oracle 10g Rel2 database.
    Is this possible with Oracle Forms or the only way to do that is to use create directory database command and use dbms_lob package which I shouldn't do, because Oracle database directory is not allowed to see my local folder.

    As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
    Public
    Sub Main()
    ' Add your code here 
    Dim f1
    As FileStream
    Dim s1
    As StreamReader
    Dim date1
    As
    Object
    Dim rline
    As
    String
    Dim Filelist(1)
    As
    String
    Dim FileName
    As
    String
    Dim i
    As
    Integer
    i = 1
    date1 =
    Filelist(0) =
    "XYZ"
    Filelist(1) =
    "123"
    For
    Each FileName
    In Filelist
    f1 = File.OpenRead(FileName)
    s1 = File.OpenText(FileName)
    rline = s1.ReadLine
    While
    Not rline
    Is
    Nothing
    If Left(rline, 4) =
    "DATE"
    Then
    date1 (i)= Mid(rline, 7, 8)
     i = i + 1
    Exit
    While
    End
    If
    rline = s1.ReadLine
    End
    While
    Next
    Dts.Variables(
    "date").Value = date1(1)
    Dts.Variables(
    "date1").Value = date1(2)
    Dts.TaskResult = ScriptResults.Success
    End
    Sub

  • How can I print PDF attachments from ABAP report in transaction ME23N?

    Hi,
    Users attach PDF files using "services for objects" in transaction ME23N.
    How can I print the PDF attachments from ABAP report ?
    Thanks in advance,,

    Hi,
      check this link,this might help you to solve your problem
    /people/thomas.jung3/blog/2005/04/28/setting-up-an-adobe-writer-for-abap-output
    Regards
    Kiran Sure

  • Exporting to multiple PDF's from one report

    I have a requirement to create multiple PDF's from one report.
    My thought is that I can I can create a foreach loop that cycles through one of my groups.  I would then like to have each file have the name of that group. 
    If anyone could help me on how to code this in C# that would be great.  I need to know where I should be putting this code (program.cs or crystalreport.cs) and how I run it.  I am assuming I don't need the viewer for this function, since this is all on my end and no users need to have access to it. 
    My other requirement is to have each of these reports be put into their own folders at C:\.  Thanks for the help in advance!

    OK. Yup, you should be able to do this. When I was reading the initial post it looked like you might have ben wanting to export only a certain section of a report (which is a no go).
    Anyhow, first thing you want to do is apply Service pack 3:
    https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
    Next, you want to look at a few sample apps and go over some docs. What you want to achieve can be done by using parameters or selection formulas.
    A good coding resources is the [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23]. Don't worry about the title, it will apply to CR 2008 also.
    Next, sample apps can be downloaded from here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    [CR 2008 developer library|http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm]
    [API reference|http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_apiRef_12_en.chm]
    Not sure if you are thinking of this being a web app, but here are some resources for that:
    [Interactivity and Reports in Web Applications|http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/208edbbf-671e-2b10-d7b5-9b57a832e427&overridelayout=true]
    Before starting your project, you should have a look at [this|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40bccdfd-88a6-2b10-1da1-c47a54b625a7] to make sure you are using the right SDK for your purposes.
    Finally, the following are links to 3rd party resources and I'm adding htese just as an FYI:
    http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx
    http://msdn.microsoft.com/en-us/magazine/cc301570.aspx
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • Can't download PDF attachments from Hotmail

    Hi,
    For the past 3 - 4 weeks, I have been unable to download PDFs attached to Hotmail messages.  The Windows forum has been unable to help.
    I'm running Windows 7, IE 9 and using Acrobat X standard.
    So far I have cleared my cache and reinstalled silverlight as the Windows guys suggested.  I also restored my computer to a point in the past when I could download attachments.
    I can download PDFs from web sites, and open existing documents.  I cannot download PDF attachments from other email accounts (such as my academic account).
    Any thoughts?

    If there is an option to download in binary mode, be sure that is selected. I do not have HotMail and have no clue what options might be available.

  • How to read a PDF file from server

    Hi All,
    I am strucked while creating new file instance .
    Here i know the URL.
    How to create the File instance by using this URL.
    I tried the following way:
    URI uri = url.toURI();
    File f = new File(uri);
    Here i got the following exception :
    <code>
    Exception in thread "main" java.lang.IllegalArgumentException: URI scheme is not "file"
    </code>
    Can any one help me?
    Thanks in advance......

    Can any one help me how can i down load a file
    from server by using URL?RTFAPI. Url.openStream().

  • Problem with opening PDF files from JSF page using SDO

    Hi all,
    I'm new with JSF and was attempting to read a PDF file from a Database using SDO and JSF. The code below throws an exception when casting from DataObject to Blob. The getLcDoc() method was created by WSAD when I dragged an SDO relational record onto the JSF page. This method returns an DataObject type which I tried casting to a Blob type before using it further. However, an exception is thrown.
    Any feedback is appreciated.
    Arv
    try {
                   FacesContext faces = FacesContext.getCurrentInstance();
                   HttpServletResponse response =(HttpServletResponse) faces.getExternalContext().getResponse();
                   Blob file= (Blob)getLcDoc().get("ATTACH");
                   int iLength = (int)(file.length());
                   response.setHeader("Content-type", "application/pdf");
                   response.setHeader("Content-Disposition", "inline; filename=Attachment");
                   response.setHeader("Expires","0");
                   response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
                   response.setHeader("Pragma","public");
                   response.setContentLength(iLength);
                   ServletOutputStream os = response.getOutputStream();
                   InputStream in = null;
                   in = file.getBinaryStream();
                   byte buff[] = new byte[1024];
                   while (true) {
                   int i = in.read(buff);
                   if (i<0) break;
                   os.write(buff,0,i);
                   os.flush();
                   os.close();
         } catch(Exception ex){
              System.out.println("Error while reading file : " + ex.getMessage());
         }

    Hi...I found out that there is actually no need to use a Blob object at all. You can simply call the OutputStreams write() method and pass the DataObject.getBytes() method that returns a byte[] array. The revised code is shown at the end of this posting.
    However, a few other teething problems exist:
    1. This works well only if I specify the content type in response.setHeader() method. What if my users upload different types of files, is there a way that the browser opens according to the file type without setting the content type?
    2. I still have a problem opening PDF files, even if I specify - response.setHeader("Content-type", "application/pdf");
    I get the message - The file is damaged and could not be repaired
    3. I would also like this to open the attachment in a new window and using target="_blank" doesn't seem to work as seen below:
    <h:commandLink
                                                 styleClass="commandLink" id="link1" action="#{pc_DocumentDetailsRead.doLink1Action}" target="_blank">
                                                 <h:outputText id="text5" styleClass="outputText"
                                                      value="Click Here"></h:outputText>
                                            </h:commandLink>
    ------------------------Revised code-----------------------------------------
    FacesContext faces = FacesContext.getCurrentInstance();
                   HttpServletResponse response =(HttpServletResponse) faces.getExternalContext().getResponse();
                   response.setHeader("Content-type", "application/msword");
                   response.setHeader("Content-Disposition", "inline; filename=Attachment");
                   response.setHeader("Expires","0");
                   response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
                   response.setHeader("Pragma","public");
                   ServletOutputStream os = response.getOutputStream();
                   os.write(getLcDoc().getBytes("ATTACH"));
                   os.flush();
                   os.close();

  • Quicklook does not work with WMV files and quick look no longer maintains resized views when viewing from a folder using the up/down arrows

    Quicklook does not work with WMV files and quick look no longer maintains resized views when viewing from a folder using the up/down arrows. Any fixes?

    Same problem here...

  • I'm trying to print a multiple page document from my ipad using an Airprint printer. Only the first page is printing, Please help?

    I'm trying to print a multiple page document from my ipad using an AirPrint printer. Only the first page is printing. Please help. The printer works correctly with my desktop and laptop.

    What version of iOS are you using?  Some people were having this problem before, and it was fixed when they updated to iOS 5.

  • How to exreact multiple pdf files from a zip files from application server to presentation server

    Hello exprts,
    I am passing one pdf file and one text file to zip file in apllication server through my custom program and then downloading it using standard function module to my desktop. its working fine. Then I added  another pdf file to my zip file. But only single pdf file is getting download . So can you please help me regardiong this issue? 

    Dear Experts ,
    I finded out the way to extrcat pdf files in presentation server. But now my problem is that I am not able to add multiple pdf files in a zip file. When I am adding new pdf file then older one is not coming in read data set. So please kindly tell me how can I add multiple pdf file in my zip file and again I can get all the pdf files from here.

  • How to Stop Large PDF attachments from displaying?

    Using Leopard and large PDF attachments (9mb) slow Mail down to a crawl. Is there a way to stop attachments from automatically displaying in Mail. It can be all atachments, it does not have to be just PDF or a certain size.
    Dan

    Hi Mulder,
    I think it must be noted that Plain or Rich Text has no bearing on Mail's ability to View in Place. Nor does View in Place have any bearing on each attachment being a true attachment. Whether it is viewed Inline by the recipient will depend entirely on the recipients email client, and not how you send.
    View in Place must not be confused with embedding images into text. The frequent discussion in these forums, and what you refer to, about whether to use Plain Text or RTF is relevant to some recipient email programs seeing inline attachments as embedded images due to the presence of the HTML that results from RTF when multiple fonts and attachments are present. The fact that the person composing sees the attachments with View in Place has no bearing on this issue involving HTML that results from RTF.
    Choosing the View as Icon while you Compose has no bearing on how the recipient's email application displays it.
    With those email clients where you can select to not view attachments inline, those you find viewing in place as you compose will in fact be seen as attached files in Icon form.
    At my request, I was sent a test message with a JPEG prepared using Iconiser -- Mail still displayed the JPEG in the message with View in Place when received. However, an examination in Raw Source form showed the header to the attachment did not have the disposition as "Inline" as it normally would -- this would aid with some recipients, such as those using Lotus Notes, where the attempt to adhere to the inline quality causes problems. But Mail, and some other email clients, can still display the message with attached images with View in Place or Inline View. The use of Iconiser will not guarantee to change that.
    As you have pointed out, zipping will prevent any form of View in Place from working.
    All the best,
    Ernie
    Message was edited by: Ernie Stamper

  • How to  delete email attachments from server

    Hi,
    I created an a CF template for sending e-mail which includes
    attachments. It has been tested on my dev box and is functioning
    fine as the attachment upload to a designated directory on the
    server. I would like the attachments to be purged once the e-mail
    has been forwarded to the recipent.
    In Macromedia's ColdFuision 7MX web application construction
    book page 913 "Interacting with Email" there is a CFC that will
    delete the file when the user ends their session.
    I am not sure how to write this to fit the code I am using.
    Here is the eMail form
    <!--- Mail_Form.cfm--->
    <html>
    <head>
    <title>Please enter your message</title>
    </head>
    <body>
    <form action="Send_Email.cfm" method="post"
    enctype="multipart/form-data">
    <table width="500" border="0" align="center">
    <tr>
    <td width = "500" colspan="2">Please enter your e-mail
    message:</td>
    </tr>
    <tr>
    <td width="250">To:</td>
    <td width="250"><input type="text" name="to_addr"
    value=""></td>
    </tr>
    <tr>
    <td>Subject:</td>
    <td><input type="text" name="subject"
    value=""></td>
    </tr>
    <tr>
    <td>Message:</td>
    <td><input textarea name="message" rows="5"
    cols="35"></textarea></td>
    </tr>
    <tr>
    <td width="250">Attachment #1:</td>
    <td width="250"><input type="file"
    name="attachment_1" value=""></td>
    </tr>
    <tr>
    <td width="250">Attachment #2:</td>
    <td width="250"><input type="file"
    name="attachment_2" value=""></td>
    </tr>
    <tr>
    <td width="250">Attachment #3:</td>
    <td width="250"><input type="file"
    name="attachment_3" value=""></td>
    </tr>
    <tr>
    <td width="250"> </td>
    <td width="250"><input type="submit"
    name="Send_Email" value="SendEmail"></td>
    </tr>
    </table>
    </form>
    Here is the form to send the attachment.
    <!--- Send_Email.cfm --->
    <!--- First make sure that the user uploaded attachments
    --->
    <cfif FORM.attachment_1 neq "">
    <!--- first actually upload the file --->
    <cffile action="upload"
    destination="D:\uploadsTEST\"
    filefield="attachment_1"
    nameconflict="makeunique">
    <!--- now create a temporary holder for the attachment
    later on --->
    <cfset attachment_local_file_1 =
    "d:\uploadsTEST\#file.serverfile#">
    </cfif>
    <!---Now repeat the process for the second and third
    attachment:--->
    <cfif FORM.attachment_2 neq "">
    <!--- first actually upload the file --->
    <cffile action="upload"
    destination="D:\uploadsTEST\"
    filefield="attachment_2"
    nameconflict="makeunique">
    <!--- now create a temporary holder for the attachment
    later on --->
    <cfset attachment_local_file_2 =
    "d\uploadsTEST\#file.serverfile#">
    </cfif>
    <cfif FORM.attachment_3 neq "">
    <!--- forst actually upload the file --->
    <cffile action="upload"
    destination="D:\uploadsTEST\"
    filefield="attachment_3"
    nameconflict="makeunique">
    <!--- now create a temporary holder for the attachment
    late on --->
    <cfset attachment_local_file_3 =
    "d:\uploadsTEST\#file.serverfile#">
    </cfif>
    <!---OK, you have now uploaded the file the server, now
    let's send
    out the email with the attachments:--->
    <cfmail FROM="[email protected]" to="#form.to_addr#"
    subject="#subject#"
    server="an001so-dby1c.pbi.global.pvt" port="25">
    #message#
    <cfsilent>
    <!--- <cfsilent> tag used to kill the white space
    in this area
    so your email is not cluttered with white space.--->
    <cfif FORM.attachment_1 neq "">
    <cfmailparam file="#attachment_local_file_1#">
    </cfif>
    <cfif FORM.attachment_2 neq "">
    <cfmailparam file="#attachment_local_file_2#">
    </cfif>
    <cfif FORM.attachment_3 neq "">
    <cfmailparam file="#attachment_local_file_3#">
    </cfif>
    </cfsilent>
    </cfmail>
    Here is the session application code to delete the file upon
    uploading
    <!---
    Filename: Application.cfc
    Executes for every page request
    --->
    <cfcomponent output="false">
    <!--- Name the application. --->
    <cfset this.name="attachmentPurge">
    <!--- Turn on session management. --->
    <cfset this.sessionManagement=true>
    <cfset this.clientMangment=true>
    <cffunction name="onSessionEnd" output="false"
    returnType="void">
    <!--- Look for attachments to delete --->
    <cfset var attachDir = expandPath("Attach")>
    <cfset var getFiles = "">
    <cfset var thisFile = "">
    <!--- Get a list of all files in the directory --->
    <cfdirectory directory="#attachDir#" name="getFiles">
    <!--- For each file in the directory --->
    <cfloop query="getFiles">
    <!--- If it's a file (rather than a directory) --->
    <cfif getFiles.type neq "Dir">
    <!--- Get full filename of this file --->
    <cfset thisFile =
    expandPath("Attach\#getFiles.Name#")>
    </cfif>
    </cfloop>
    </cffunction>
    </cfcomponent>
    The tutorial only explains how to delete the attachment when
    the recipient checks there mail
    in the POP server.
    Assuming that the sender is in a session would the code be
    written to delete the attached file from the directory on
    the server one the e-mail is sent.
    Can someone explain how to automatically delete email
    attachments from a designated directory or provide me with the code
    that would handle this after an email is sent with attachment.
    Thanks,
    Tony

    I don't know why your dos code didn't run. It could be
    addressing. My limited experience with cfdirectory/cffile/cfexecute
    is to type out the complete path at least once.
    Good books?
    Hard to say, depends on what else you are new at. If you are
    new to html, then htmlgoodies.com has good tutorials. So does
    webmonkey.com. If you have trouble with sql, I have heard good
    things about the SAMS book, Teach Yourself SQL in 10 Minutes by Ben
    Forta. I learned javascript by buying the book Teach Yourself
    Javascript in 24 Hours. The O'Reilly books are also good. I learned
    awk with one of those books.
    Glad you liked the fish pics. The camera is specified on most
    of the pages. If it says Reefmaster, I used an external strobe. If
    it says Sony I either used the camera flash only or natural light.
    By the way, that is not a Cold Fusion site. It's strictly html and
    javascript.

  • Unable to view PDF attachments from my iPhone.

    I am using service called RightFax this service is send the faxes to clients mailboxs. I have been reported from clients that they are unable to view the attachmentson their iPhones, the attachment format is PDF. The attachment can be openned from any desktops and Android phones without any issue.
    i can see attachment from on my iPhone but when i tab on it to view it it just scrolled up to the top of the mail. Also if i farward the same fax mail to my self then i can view the attachment.The IOS version is 7.1.
    I contact the RightFax company to check with them why only attachments from fax mails with PDF format is not openning from iPhone devices from the first time, the company check theur services and do tests and reply me that there is no issue with their services since the PDF attachments are openned on android and desktops. They informed me that it might could be compatability issue between Exchange 2013 and apple that doesn't allowed PDF attachments to be openned from the first time, so they advised to contact Apple support to find out why PDFs are not openning when i initially attempt to download them.
    I download third party mail client on my iPhone and all fax attachments are openned without problem.
    Could anyone help me with this strange issue ??

    RightFax advised you to contact Apple Support - this is NOT Apple Support but rather a public user to user technical support forum.
    As far as I know, it is not possible to open PDF attachments on an iPhone, but it is on an Android phone, which is why you are having the problems - unless there is an app to help you that you can purchase in the app store, then there is not a lot you can do about this, except switch to an android phone, but as far as I know, you have never been able to open PDF documents on an iPhone.

Maybe you are looking for

  • Iphone 3Gs Backup issues - "Unknown" time stamp 01/01/2001 01:00

    Since updating to iTunes 9.2 for windows my phone will not back up or sync. I deleted the old backups thinking this was the problem. Now all I get after the backup running for 20 hours straight is an "Unknown" backup time stamped 01/01/2002 01:00.

  • Hp dvd-ram uj8b1 has a driver problem

    HP Pavilion dv6 Notebook PC Windows 7 home premium We were able to play Cds and Dvds, and now they are not playing.  I did download i-tunes recently, but don't recall if the problem emerged immediately after that.  We don't use discs very often.  Whe

  • Is there any way to manage multiple CC memberships from a single account?

    Is there any way for all our CC accounts to be managed by a single account, to manage things such as billing, etc? It would save my company time and confusion when we have to do things such as set up a new credit card number (which we would have to d

  • Wls 8.1 sp4 jms store

    Hi,           I need to move the jms store (for jms server) from file based to db based.           Server has:           Distributed Queue Members           Distributed Topic Members           Durable Topic Subscriber           Persistent Messages (p

  • Wireless constantly disconnects

    Hi, I am running an extremely old laptop (inspiron 4100) with lxde. The card I am using is a linksys PCMCIA the chipset is BCM4306 Rev 3. The wireless would constantly disconnect and not reconnect using "Network-manager". I am now trying to connect m