Forums

Form to download a file

giacall 08 May, 2017
Hi to all.. And compliments for V6 in chronoforms and chronoconnectivity.

I need a little advice.
I build a simple form with a dropdown menu (id: sel_catalogue) and a submit button.
The dropdown is a single select with 2 option:
  • file_1.pdf=FILE 1

  • file_2.pdf=FILE 2

  • I would like use this form to guide and trace the user in downloading some file from server.

    So, in SETUP SECTION -> SUBMIT AREA a put a EMAIL Action.
    In attachment list, i try to insert images/CAST/CATAL/{data:sel_catalogue}

    But the dubugger tell me that email could not be sent with the following error:
    Array
    (
        [chronoform] => CAST_DES_DOWNLOAD_CATALOGUE
        [event] => submit
        [sel_catalogue] => file_1.pdf
        [button2] => 
    )


    Array
    (
        [email5] => Array
            (
                [recipients] => Array
                    (
                        [0] => glc@xxxxxxxxx.com
                    )
    
                [subject] => Catalogo
                [body] => Ciao.
    <table width="100%" cellpadding="0" cellspacing="0" border="0" class="ui table"><tr><td width="30%" valign="top" align="right">Dropdown</td><td width="70%" valign="top" align="left"><strong>sca.pdf</strong></td></tr><tr><td width="30%" valign="top" align="right">File</td><td width="70%" valign="top" align="left"><strong></strong></td></tr></table>
                [files] => Array
                    (
                        [0] => images/CAST/CATAL/file_1.pdf
                    )
    
                [from_name] => METALDIVISION
                [from_email] => postmaster@xxxxxxxxx.com
                [result] => the Mail could not be sent.
                [var] => 
            )
    
    )


    But if i set, in the atachment list, the path without parameter images/CAST/CATAL/file_1.pdf, the mail is sent and delivered correctly.

    Array
    (
        [chronoform] => CAST_DES_DOWNLOAD_CATALOGUE
        [event] => submit
        [sel_catalogue] => file_1.pdf
        [button2] => 
    )


    Array
    (
        [email5] => Array
            (
                [recipients] => Array
                    (
                        [0] => glc@xxxxxxxxxxxx.com
                    )
    
                [subject] => Catalogo
                [body] => Ciao.
    <table width="100%" cellpadding="0" cellspacing="0" border="0" class="ui table"><tr><td width="30%" valign="top" align="right">Dropdown</td><td width="70%" valign="top" align="left"><strong>sca.pdf</strong></td></tr><tr><td width="30%" valign="top" align="right">File</td><td width="70%" valign="top" align="left"><strong></strong></td></tr></table>
                [files] => Array
                    (
                        [0] => images/CAST/CATAL/file_1.pdf
                    )
    
                [from_name] => METALDIVISION
                [from_email] => postmaster@xxxxxxxxx.com
                [result] => the Mail sent successfully.
                [var] => 1
            )
    
    )


    It's my mistake??

    Sorry for my english

    LUCA
    giacall 08 May, 2017
    Thank's Calculus00..

    Unofrtunately.. this time.. Yoiu can not help me...πŸ˜€πŸ˜€πŸ˜€
    Max_admin 08 May, 2017
    Hi Luca,

    In the 2nd case, the attachment is delivered with the email ?

    Best regards,
    Max
    Max
    ChronoForms developer...
    Did you try ChronoMyAdmin for managing your Joomla database tables ?
    giacall 09 May, 2017
    Hi Max.
    Thank's for replay.
    Yes.. In the 2nd case.. The is delivered with the mail.
    The only difference in the deugger is in the end of the same..
    If I put in the attachment list the strin images/CAST/CATAL/{data:sel_catalogue} the debugger (at the end..) say
    [from_name] => METALDIVISION
    [from_email] => postmaster @[at] xxxxxxxxx [dot] com
    [result] => the Mail could not be sent.
    [var] =>
    


    otherway, if i put in attachment list the string images/CAST/CATAL/file_1.pdf the debugger is :
    [from_name] => METALDIVISION
    [from_email] => postmaster @[at] xxxxxxxxx [dot] com
    [result] => the Mail sent successfully.
    [var] => 1
    
    
    giacall 11 May, 2017
    Hi Max..
    Have you some news about my issue?

    Thank's

    Luca
    Max_admin 11 May, 2017
    Hi Luca,

    Its not very secure to pass a file name in the form, please try the following:
    change the dropdown options to this:
    
    1=File1
    2=file2
    

    Add a "Switch" action before the email action, lets assume the name of the switch action is "switch123", in the "data provider" add: {data:sel_catalogue}, in the values setup add this:
    
    1:file_1.pdf
    2:file_2.pdf
    

    Enable the "return result as var" setting.
    Now in your email action attachments box, instead of using {data:sel_catalogue}, please use: {var:switch123}

    Please try that and let me know.

    Best regards,
    Max
    Max
    ChronoForms developer...
    Did you try ChronoMyAdmin for managing your Joomla database tables ?
    giacall 12 May, 2017
    Hi Max.
    Thank's for replay.
    Unfortunately, the does not work.
    The error is the same.
    The {var:switch123} is passed correctly, but i receive the same error.
    The debugger say:
    Array
    (
        [chronoform] => CAST_RICH_CATALOGUE
        [event] => submit
        [Salutation] => 
        [nome] => xx
        [cognome] => xx
        [email] => calloni.gianluca@xxx.com
        [sel_catalogue] => 2
        [secicon27] => 59157a3739c25
        [invia] => 
    )


    Array
    (
        [email12] => Array
            (
                [recipients] => Array
                    (
                        [0] => calloni.gianluca@xxx.com
                    )
    
                [subject] => CAST-DES: Catalogue file_2.pdf
                [body] => HI fd fd.
    
    Attached you can find the catalogue file_2.pdf.
    
    Do not esitate to contact us for any further information.
    
    Staff
                [files] => Array
                    (
                        [0] => images/CAST-DES/CATALOGHI/file_2.pdf
                    )
    
                [from_name] => CAST DESIGNER
                [from_email] => cast-des@xxx.it
                [result] => the Mail could not be sent.
                [var] => 
            )
    
    )
    Max_admin 12 May, 2017
    Answer
    Hi Luca,

    Ok, I found a small glitch, it should be fixed in the next update, but for now you will need to return the full path from the switch function:
    
    1:images/CAST-DES/CATALOGHI/file_1.pdf
    2:images/CAST-DES/CATALOGHI/file_2.pdf
    


    Best regards,
    Max
    Max
    ChronoForms developer...
    Did you try ChronoMyAdmin for managing your Joomla database tables ?
    giacall 12 May, 2017
    Yesssss Max..
    Thank's.. This work fine.
    So.. When you deploy the next update, i must modify the form or i could leave it as is ?

    Thank you
    Max_admin 12 May, 2017
    Hi Luca,

    No problems!

    No, this way should work fine now and after the update, but your original method should work fine after the update!

    Best regards,
    Max
    Max
    ChronoForms developer...
    Did you try ChronoMyAdmin for managing your Joomla database tables ?
    This topic is locked and no more replies can be posted.