Does anyone know of a way to have a form field (with browse capability) to select a file that can be attached to an email rather than uploading the file to our servers?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What's the point?
Forms use an email server on the web host where the form resides. In order to send the fila as an attachment the file needs to be uploaded anyway. The file would have to be uploaded, sent, then deleted.
Here is a link to a site discussing the code required to do what you want. The phpFormgenerator does not implement anything like this so the coding is up to you.
The point is from a "user-friendly standpoint by non-technical users". It is much easier for a non-techie to open an email attachment than to learn how to install/learn/setup/use an ftp client.
By the way we are using version 2.09, but would switch to any version that makes the form creation for email attachments easy to implement.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
From a non-technical point of view there is nothing simpler that pointing your browser to a link, right clicking, and choosing "save file as".
For this you need to upload the file to your web server and send a link in the email to your form recipient. This reduces email storage requirements and internet bandwidth for the world if the form recipient has no intention of ever getting the file.
You should always try to limit storage requirements and data transfer bandwidth whenever possible. I don't know what limits your host imposes on you but I know my host limits bandwidth on a monthly basis. If I exceed the limit I must pay more for my account. If you do what you are suggesting then every file will transmit twice, doubling the bandwidth utilization every time someone uses your form.
Ultimately the decision is yours and you can modify the generated form to do anything you want. There is no version of phpFormgenerator that implements this feature.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have taken your advise and it works simple enough to train an enduser, especially with the link in the email. Thanks for your help.
The only issue remaining is clean-up maintenance on the files folder. How does a user easily delete the files he has downloaded. FTP or is there an easier method?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This delete feature is a bit more complicated because you don't want any user to be capable fo deleting any file.
You could create a delete file php script and send this as a link to the user via the email as well. The link would look something like this: http://yoururl/formfolder/delete_file.php?fn=filename
The delete_file.php file would look something like this:
<?php
$file=$_GET['fn'];
unlink(”http://yoururl/formfolder”.”/”.$file);
?>
Note this is a very simplistic implementation that makes no effort to ensure it can not be abused. You might think about making some record of files and assosiated random number that would allow you to prevent unautorized deleting of files. In this case your delete link sent in the email would look something like this: http://yoururl/formfolder/delete_file.php?fn=filename&rn=12345abcd6789
The delete_file.php file would then look something like this:
<?php
$match=0;
$file=$_GET['fn'];
$security_string=$_GET['rn'];
//Code to open record file and check for match between file name and random number.
//If a match is found, delete file, if not print warning message.
if($match) {
unlink(”http://yoururl/formfolder”.”/”.$file);
} else {
echo "You are not authorized to delete this file. If you think this is in error please contact the administrator at webmaster@yoururl.com";
}
?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The user who receives the email has administrative responsibilities, so I'm not sure which method for deleting files I will use. But thanks again for all your help. You have been very responsive and helpful. I think I can handle it from here.
I have been using phpformgen for quite some time in very basic applications. It is easier than most other form mailers to setup/modify by copy/pasting the code into our pages. Now that you have taught me the more complex uses, I'm glad that I chose phpFormGen.
Thanks again.
By the way, other form mailers have an email attachment field option with browse capability and I still think that would be the easiest option for many end-user applications. Most all end-users know how to open an email attachment, so no training is required and no folder maintenance (deleting) would be required, either. Even when you consider the bandwidth issue... the legitimate attachments that would be included in our forms wouldn't even make a small dent in the overall internet traffic, especially when you consider all the spam & virus traffic, spiderbots, etc.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does anyone know of a way to have a form field (with browse capability) to select a file that can be attached to an email rather than uploading the file to our servers?
What's the point?
Forms use an email server on the web host where the form resides. In order to send the fila as an attachment the file needs to be uploaded anyway. The file would have to be uploaded, sent, then deleted.
Here is a link to a site discussing the code required to do what you want. The phpFormgenerator does not implement anything like this so the coding is up to you.
http://zainal.wordpress.com/2007/01/10/sending-email-attachments-in-php-using-phpmailer-class/
The point is from a "user-friendly standpoint by non-technical users". It is much easier for a non-techie to open an email attachment than to learn how to install/learn/setup/use an ftp client.
By the way we are using version 2.09, but would switch to any version that makes the form creation for email attachments easy to implement.
From a non-technical point of view there is nothing simpler that pointing your browser to a link, right clicking, and choosing "save file as".
For this you need to upload the file to your web server and send a link in the email to your form recipient. This reduces email storage requirements and internet bandwidth for the world if the form recipient has no intention of ever getting the file.
You should always try to limit storage requirements and data transfer bandwidth whenever possible. I don't know what limits your host imposes on you but I know my host limits bandwidth on a monthly basis. If I exceed the limit I must pay more for my account. If you do what you are suggesting then every file will transmit twice, doubling the bandwidth utilization every time someone uses your form.
Ultimately the decision is yours and you can modify the generated form to do anything you want. There is no version of phpFormgenerator that implements this feature.
I have taken your advise and it works simple enough to train an enduser, especially with the link in the email. Thanks for your help.
The only issue remaining is clean-up maintenance on the files folder. How does a user easily delete the files he has downloaded. FTP or is there an easier method?
This delete feature is a bit more complicated because you don't want any user to be capable fo deleting any file.
You could create a delete file php script and send this as a link to the user via the email as well. The link would look something like this:
http://yoururl/formfolder/delete_file.php?fn=filename
The delete_file.php file would look something like this:
<?php
$file=$_GET['fn'];
unlink(”http://yoururl/formfolder”.”/”.$file);
?>
Note this is a very simplistic implementation that makes no effort to ensure it can not be abused. You might think about making some record of files and assosiated random number that would allow you to prevent unautorized deleting of files. In this case your delete link sent in the email would look something like this:
http://yoururl/formfolder/delete_file.php?fn=filename&rn=12345abcd6789
The delete_file.php file would then look something like this:
<?php
$match=0;
$file=$_GET['fn'];
$security_string=$_GET['rn'];
//Code to open record file and check for match between file name and random number.
//If a match is found, delete file, if not print warning message.
if($match) {
unlink(”http://yoururl/formfolder”.”/”.$file);
} else {
echo "You are not authorized to delete this file. If you think this is in error please contact the administrator at webmaster@yoururl.com";
}
?>
The user who receives the email has administrative responsibilities, so I'm not sure which method for deleting files I will use. But thanks again for all your help. You have been very responsive and helpful. I think I can handle it from here.
I have been using phpformgen for quite some time in very basic applications. It is easier than most other form mailers to setup/modify by copy/pasting the code into our pages. Now that you have taught me the more complex uses, I'm glad that I chose phpFormGen.
Thanks again.
By the way, other form mailers have an email attachment field option with browse capability and I still think that would be the easiest option for many end-user applications. Most all end-users know how to open an email attachment, so no training is required and no folder maintenance (deleting) would be required, either. Even when you consider the bandwidth issue... the legitimate attachments that would be included in our forms wouldn't even make a small dent in the overall internet traffic, especially when you consider all the spam & virus traffic, spiderbots, etc.