From: Jonathan S. <jn...@ge...> - 2006-02-20 21:01:57
|
On Mon, 2006-02-20 at 18:01, Harry Smith wrote: > I think I have followed the readme instructions but cannot get file uploads > to work after a confirmation page. > > I have a page where you browse for a file to upload. You then click a > submit button which takes you to a confirm page where you check upload > details are correct. You then hit a submit button to send the file plus > other text info. > > I have tried a confirm.trc with > > no_email: 1 > success_page_template: upload_sucesspage > > and a confirm page including this trc > > recipient:me@site > email_template:my_email > upload_afile:doc pdf rtf txt > print_blank_fields:true > > Both the initial html page and the confirm page use: > <form method="post" enctype="multipart/form-data" > action="/cgi-bin/TFmail.pl"> > > although I have tried other variations on this. > > The problem is I assume that the <input type="file" name="afile"> becomes > <input type="hidden" name="afile"> in the html confirm page. > > If I put <input type="file" > in the first entry form entry page and then > add > > recipient:me@site > email_template:my_email > upload_afile:doc pdf rtf txt > > to the confirm.trc then the file is sent as an e-mail attachment. But this > makes the confirm button meaningless. > > Equally, if I put <input type="file" > in the confirm form I then get a > browse button to go to a file and upload it. But then this is not a confirm > form anymore. > > How can I pass a file to upload to a confirm form. It would need to be an > input with features of both <input type="file" > and <input type="hidden" > > I suppose. Unfortunately there is a fundamental problem with this (or two depending on how you look at it.) The 'file' input type causes the content of the file to be uploaded with the submission of the form and for fairly obvious security reasons the only way to specify the file to upload is by selecting it through the 'browse button' (or whatever mechanism the browser supplies to select the file to upload.) So no you can't have a 'hidden' file input field. The only way in the general sense that one could achieve this is to save the file on the first submission when it is uploaded and then when the confirmation page is submitted retrieve the saved file and attach it to the email. Unfortunately TFmail can't currently do this, it is entirely doable but it will require some thought to be able to do it efficiently and securely (there is a need to retain some state information and ensure that no files get overwritten) and I'm not able to give a time frame when we can implement it. I've copied the developers list in case anyone has the time to implement this. I don't think we can offer you a solution in the short term I'm afraid, a lot of the pieces needed are there but there is no way to tie them together. /J\ -- This e-mail is sponsored by http://www.integration-house.com/ |