Contact Form Changes from v1.1 to v1.2
globals.php
This is a guide for Contact Form with Mail Attachments component and specifies what has changed from v1.1 to v1.2.
For a step-by-step installing guide for this component check the Step-by-step installing guide but keep in mind the changes in this post.
Contact Form with Mail Attachments is a Flash, actionscript 3, mail contact form component that suppports multiple mail attachments. The server side script is in php.
added $UPLOAD_CONTAINING_FOLDER : this is where the upload directory can be set.
Note that the directory set here must exist! It default to “./files/” but you still need to create it. This directory is relative to where the php script files are located.
upload_file.php
now requires “globals.php”: it looks after $UPLOAD_CONTAINING_FOLDER as it will upload files into this folder(actually it will create new temporary directories)
Safety check added here
sendmail.php
and same safety checks added here too.
Fixed issues with php scripts
php would diskard files bigger than the maximum file upload (from php.ini) and upload script would fail: fixed now
sendmail.php would fail to delete the created files and directory upon completion: fixed
Contact form
The swf file: fixed bugs and issues and made more robust.
if files were selected for upload, then all the files delete from the list and the form submitted, an error was thrown by flash: now it’s taken into account
some other minor bugs fixed
if something is not working right, please check out the flash log file (flash player debugger version is required) as important information can be output about what the cause of the problem might be
This version should be installed ASAP!
http://www.flashcomponents.net/component/contact_form_mail_with_attachments.html?ref=pinosh


Hi Dude!.. im having some problems with files, i can’t sent attachments, i have the 1.2 version, but its weird.. i can send normal messages but not with files, the thing is that i have a lot of doubts!.. for example, the name of the upload folder files can be “files” but how do i put it on the variable.. i mean, should i put “files” or “../files” .. cuz with your example ( “./files/” ) im a little bit lost! =) .. and another thing, this folder has to hve the 755 permission? or witch one!…
and the last thing .. i have to put the root of the folder in both files? ( upload_fil.php & globals.php?)
thanks for the support man! and sorry, it may been stupid questions but as you can see im dont have a lot of experience programing!.
@andres
Hi andres.
“./files” – means that the “files” folder is in the current directory (that is the directory “globals.php” resides in) : For example:
As you can see from the directory structure above, the “files” folder is in the same directory as the “globals.php”, inside the “scripts” directory. The “./” before the “files” name, says that the files directory is inside the current directory.
Make sure you set only 1 “.” “./files” and not 2. “../files” means that “files” directory is located in the parent directory of the current directory.
Also “./files” and “./files/” are equivalent in these scripts, both of the methods should work.
This directory “files” directory must have 775 permissions, but that depends on your server configuration. (php needs r+w permissions)
You don’t need to change anything inside “upload_file.php”. You only set settings in “globals.php”.
Here is a directory structure that works with the default “./files”:
Now of course some of the files here can be missing if you’re not using those, like: the “js” folder if you’re not embedding the form on a html page using the the javascript method, as in “index.html”, “expressinstall.swf” is for flash player detection and installing, and “index.html” is just a sample html file of how the form can be embedded.
hey!
cool & thanks for your help!
I am trying to add a text field to send another piece of information. How can I do that?
In order to add a new text field, you need to have some basic knowledge of flash. Firstly you need to open the .fla file in your Flash environment (Flash CS3 or CS4 only), go to where you want the place the new textfield, create a text field using the text tool, if you want to be an input field, make sure you set it’s type to be Input, give it an instance name.
Next depending on how you want the new piece of information sent, you can go to ContactForm.as file, find the completeUpload method and inside this method find the line variables.message = this.message_.text; and concat the text from the message with the text from you new textfield. This way you will send the new text as part of the message.
If you want your new text field to represent subject or other email related field, then it is a bit more evolved, and you need to change php also.
Ovidiu
Hi, I’m having the following problem:
When I send a message without an attachment, everything works fine. As soon as I send an attachment, the text of the message isn’t transmitted anymore. Please help!
Greetz,
Nik
@nikusch
problem solved, your support is great – thanks!
i have the same problem as nikush, i do not get the text of the message if i attach a file…
but it seem that correction for it is not posted here…
please help:)
bruno