Buy Now
Sign in

Form to download a file

giacall , May 08 2017, 17:21
G
giacall 97
May 08 2017, 17:21 #367903
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
G
giacall 97
May 08 2017, 17:26 #367905
Thank's Calculus00..

Unofrtunately.. this time.. Yoiu can not help me...
admin 30
May 08 2017, 22:39 #367919
Hi Luca,

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

Best regards,
Max
G
giacall 97
May 09 2017, 10:03 #367926
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

G
giacall 97
May 11 2017, 16:43 #368015
Hi Max..
Have you some news about my issue?

Thank's

Luca
admin 30
May 11 2017, 23:17 #368034
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
G
giacall 97
May 12 2017, 13:05 #368062
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] =>
)

)
admin 30
May 12 2017, 15:22 #368074
 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
G
giacall 97
May 12 2017, 18:23 #368082
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
admin 30
May 12 2017, 18:55 #368084
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
G
giacall 97
May 12 2017, 18:58 #368085
 1
Ok.
Thank's again

Luca