close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Getting File Upload to work

Thread began 1/13/2010 10:25 am by jay.malik396220 | Last modified 1/13/2010 4:46 pm by jay.malik396220 | 6909 views | 7 replies


Simple Example

I created a new and simple form with all behaviors in the same page. No upload, and no attachment to the email (no errors raised either).

Form Code:
<?php require_once("../../WA_DigitalFilePro/HelperPHP.php"); ?>
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../uploads",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
WA_DFP_UploadFiles("WA_UploadResult1", "upload", "0", "", "false", $WA_UploadResult1_Params);
<?php require_once("../../WA_Universal_Email/mail_PHP.php"); ?>
<?php require_once("../../WA_Universal_Email/MailFormatting_PHP.php"); ?>
if ((isset($_POST["send"]))) {
//WA Universal Email object="mail"
//Send Loop Once Per Entry
$RecipientEmail = "";include("../../WA_Universal_Email/WAUE_upload_1.php");

//Send Mail All Entries
header("Location: ");

$insertGoTo = "thankyouemail.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns=""><!-- InstanceBegin template="../../Templates/Centerline_Pages.dwt" codeOutsideHTMLIsLocked="false" -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../Assets/CSS/centerline_09.css" rel="stylesheet" type="text/css" />
<!--[if lte IE 6]>
<style type="text/css" media="all">
@import url("../../CSSMenuWriter/cssmw/menu_ie.css");
<script type="text/javascript" src="../../CSSMenuWriter/cssmw0/menu.js"></script>
<style type="text/css" media="all">
@import url("../../CSSMenuWriter/cssmw0/menu.css");
<!--[if lte IE 6]>
<style type="text/css" media="all">
@import url("../../CSSMenuWriter/cssmw0/menu_ie.css");
<!--[if lte IE 6]>
<style type="text/css" media="all">
@import url("../../CSSMenuWriter/cssmw1/menu_ie.css");

<script type="text/javascript">
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

<!-- InstanceBeginEditable name="doctitle" -->
<title>SSRS Reporting for Dynamics NAV</title>
<!-- InstanceEndEditable -->

<meta name="Keywords" content="Microsoft Dynamics NAV,SSRS,Reporting Services,Pivotier,Flowfields,Report Definition Language,RDL,SQL Server" />

<div id="content">
<div id="Header">
<div id="leftcolumnbubble"></div>
<div id="rightcolumnbubble"></div>
<div id="gutterbubble"></div>
<div id="headerbubble"></div>
<div id="logo">
<div id="cline"><img src="../Assets/Elements/CEN_Weblogo.png" alt="logo" width="274" height="64" hspace="10" vspace="5" border="0" usemap="#GoHome" onload="MM_preloadImages('Assets/Elements/CEN_Webbox_TopLeft_03.png','Assets/Elements/images/currency.png','Assets/Elements/images/jumpers.png','Assets/Elements/images/Modernize.png','Assets/Elements/images/SSRS.png','Assets/Elements/images/visualize.png')" />
<map name="GoHome" id="GoHome">
<area shape="rect" coords="5,5,270,59" href="Centerline_Home.php" alt="Go to home page" />
<div id="title"><br />
<p><!-- InstanceBeginEditable name="Page_Menu_Text" -->Page_Menu_Text<!-- InstanceEndEditable --></p>
<div id="TitleBubble"></div>
<div id="navigation">
<p><?php require_once("../../CSSMenuWriter/cssmw0/menu.php"); ?></p>
<div id="pagecontent">
<div class="leftcolumn"><b class="rtop"><b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b></b>
<div id="leftcolumncontent"><!-- InstanceBeginEditable name="Left_Column" -->Left_Column<!-- InstanceEndEditable --></div>
<b class="rbottom"><b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b></b>
<div class="rightcolumn"><b class="rtop"><b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b></b>
<div id="rightcolumncontent"><!-- InstanceBeginEditable name="Right_Column" -->
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
<input type="text" name="name" id="name" />
<input type="text" name="email" id="email" />
<label>Select a File
<input type="file" name="upload" id="upload" />
<input type="submit" name="send" id="send" value="Send" />
<!-- InstanceEndEditable --></div>
<b class="rbottom"><b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b></b>
<div id="footer">
<a href="contactus.php">Contact</a> | <a href="terms.php">Terms of Use</a> | <a href="privacy.php">Privacy</a> | <a href="Login.php">Login</a> | <a href="logout.php">Logout</a> | <a href="Centerline_Home.php">Home</a><br />
<br />
Copyright &copy; 2009-2010 Centerline Software, Inc. </div>
<!-- InstanceEnd --></html>

Email code:
$MailAttachments = "";
$MailBCC = "";
$MailCC = "";
$MailTo = "";
$MailBodyFormat = "";
$MailBody = "";
$MailImportance = "";
$MailFrom = "".$_SESSION['FirstName'] ."|WA|".$_SESSION['Email'] ."";
$MailSubject = "Support Email";

//Global Variables

$WA_MailObject = WAUE_Definition("","25","","","","");

if ($RecipientEmail) {
$WA_MailObject = WAUE_AddRecipient($WA_MailObject,$RecipientEmail);
else {
//To Entries

//Attachment Entries
//$WA_MailObject = WAUE_AddAttachment($WA_MailObject,"".((isset($_COOKIE[""]))?$_COOKIE[""]:"") ."");
$WA_MailObject = WAUE_AddAttachment($WA_MailObject,"".(realpath("../".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"])) ." ");

//BCC Entries

//CC Entries

//Body Format
$WA_MailObject = WAUE_BodyFormat($WA_MailObject,0);

//Set Importance
$WA_MailObject = WAUE_SetImportance($WA_MailObject,"3");

//Start Mail Body
$MailBody = $MailBody . "<html><head></head><body>\r\n";
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . "<p>Name: ";
$MailBody = $MailBody . ((isset($_POST["name"]))?$_POST["name"]:"");
$MailBody = $MailBody . "</p>\r\n";
$MailBody = $MailBody . "<p>Email: ";
$MailBody = $MailBody . ((isset($_POST["email"]))?$_POST["email"]:"");
$MailBody = $MailBody . "</p>\r\n";
$MailBody = $MailBody . "</body></body></html>";
//End Mail Body

$WA_MailObject = WAUE_SendMail($WA_MailObject,$MailAttachments,$MailBCC,$MailCC,$MailTo,$MailImportance,$MailFrom,$MailSubject,$MailBody);

$WA_MailObject = null;

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...