close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Progress Bar & UE attachment problems

Thread begun 9/19/2010 9:44 pm by jarrad407561 | Last modified 9/24/2010 11:44 am by Jason Byrnes | 2991 views | 8 replies |

jarrad407561

Progress Bar & UE attachment problems

Hi,
I can't seem to get my progress bar to work, i have had it working on pages in the past, and looking through the code i cannot see where i have gone wrong..

The page i'm having troubles with is:
submissions.php

<head>
<script src="webassist/progress_bar/jquery-blockui-formprocessing.js" type="text/javascript"></script>
</head>
<body>
<div id="submissions_ProgressWrapper">
<form action="" method="post" enctype="multipart/form-data" name="submissions" id="submissions">............................
</form>
</div>
<div id="submissions_ProgressMessageWrapper" class="blockUIOverlay" style="display:none;">
<script type="text/javascript">
WADFP_SetProgressToForm('submissions', 'submissions_ProgressMessageWrapper', WADFP_Theme_Options['ExtendingWheel:Slate']);
</script>
<div id="submissions_ProgressMessage">

<p style="margin:10px; padding:5px;" ><img src="webassist/progress_bar/images/slate-wheel.gif" alt="" title="" style="vertical-align:middle;" />&nbsp;&nbsp;Please wait</p>

</div>
</div>
</body>



I'm also having trouble with large file attachments to emails.. A 5mb attachment works, but a 10mb attachment wont work, it uploads the whole file and when done it just reloads the page instead of going to the $GoToPage, and doesn't send the email..
I need to either allow large attachments (at least 25mb or so) or include some validation so that only small attachments can be attached (which i'm not sure how to do).

Please help.

Jarrad
ps. i'm using Universal Email v4.00

Sign in to reply to this post

jarrad407561

I've managed to fix my problem of only being able to send 8mb attachments, i've changed my php.ini file to allow "post_max_size = 128M", but i've tested it with a 20MB attachment, the email was sent but i received this error instead of the $GoToPage:

  Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 30395605 bytes) in /home/fingerma/public_html/submissions.php on line 97  



It doesn't add up, the memory limit is 128MB, and it's exhausted the limit at 28MB??
What have i done wrong now??

btw. still no luck with the progress bar.. :( any ideas?

Thanks,

Jarrad

Sign in to reply to this post

Jason ByrnesWebAssist

for the progress bar change:

<script type="text/javascript">
WADFP_SetProgressToForm('submissions', 'submissions_ProgressMessageWrapper', WADFP_Theme_Options['ExtendingWheel:Slate']);
</script>




to:

<script type="text/javascript">
WADFP_SetProgressToForm('submissions_ProgressWrapper', 'submissions_ProgressMessageWrapper', WADFP_Theme_Options['ExtendingWheel:Slate']);
</script>





If you are saving multiple copies of the file, or have the upload set to resize an image, it can easily use up the 128mb memory limit, the gd processor that is used to re-size images is very memory intensive.

try upping the memory limit to 256mb

Sign in to reply to this post

jarrad407561

Thanks for your reply Jason,

The progress bar is now working, thanks :)

As for the memory limit problem, I'm not doing any resizing or image processing, all it's basically doing is uploading a file (any file) and attaching it to an email with other form data.

For a test i tried attaching a 20 MB zip file (as i need it to be able to handle at least 20-30 MB attachments). this is where i got the memory error.. (although the email and attachment was sent, instead of the $gotopage i got the memory error.

Here is the UE code:

<?php require_once("webassist/email/mail_php.php"); ?>
<?php require_once("webassist/email/mailformatting_php.php"); ?>
<?php
if (!isset($_SESSION))session_start();
if ((isset($_POST["submit_submit"]))) {
//WA Universal Email object="mail"
set_time_limit(0);
$EmailRef = "waue_submissions_1";
$BurstSize = 200;
$BurstTime = 1;
$WaitTime = 1;
$GoToPage = "submission_received.html";
$RecipArray = array();
$StartBurst = time();
$LoopCount = 0;
$TotalEmails = 0;
$RecipIndex = 0;
// build up recipients array
$CurIndex = sizeof($RecipArray);
$RecipArray[$CurIndex] = array();
$RecipArray[$CurIndex ][] = "submissions@fingermagazine.com.au";
$TotalEmails += sizeof($RecipArray[$CurIndex]);
$RealWait = ($WaitTime<0.25)?0.25:($WaitTime+0.1);
$TimeTracker = Array();
$TotalBursts = floor($TotalEmails/$BurstSize);
$AfterBursts = $TotalEmails % $BurstSize;
$TimeRemaining = ($TotalBursts * $BurstTime) + ($AfterBursts*$RealWait);
if ($TimeRemaining < ($TotalEmails*$RealWait) ) {
$TimeRemaining = $TotalEmails*$RealWait;
}
$_SESSION[$EmailRef."_Total"] = $TotalEmails;
$_SESSION[$EmailRef."_Index"] = 0;
$_SESSION[$EmailRef."_Remaining"] = $TimeRemaining;
while ($RecipIndex < sizeof($RecipArray)) {
$EnteredValue = is_string($RecipArray[$RecipIndex][0]);
$CurIndex = 0;
while (($EnteredValue && $CurIndex < sizeof($RecipArray[$RecipIndex])) || (!$EnteredValue && $RecipArray[$RecipIndex][0])) {
$starttime = microtime_float();
if ($EnteredValue) {
$RecipientEmail = $RecipArray[$RecipIndex][$CurIndex];
} else {
$RecipientEmail = $RecipArray[$RecipIndex][0][$RecipArray[$RecipIndex][2]];
}
$EmailsRemaining = ($TotalEmails- $LoopCount);
$BurstsRemaining = ceil(($EmailsRemaining-$AfterBursts)/$BurstSize);
$IntoBurst = ($EmailsRemaining-$AfterBursts) % $BurstSize;
if ($AfterBursts<$EmailsRemaining) $IntoBurst = 0;
$TimeRemaining = ($BurstsRemaining * $BurstTime * 60) + ((($AfterBursts<$EmailsRemaining)?$AfterBursts:$EmailsRemaining)*$RealWait) - (($AfterBursts>$EmailsRemaining)?0:($IntoBurst*$RealWait));
if ($TimeRemaining < ($EmailsRemaining*$RealWait) ) {
$TimeRemaining = $EmailsRemaining*$RealWait;
}
$CurIndex ++;
$LoopCount ++;
session_commit();
session_start();
$_SESSION[$EmailRef."_Index"] = $LoopCount;
$_SESSION[$EmailRef."_Remaining"] = round($TimeRemaining);
session_commit();
wa_sleep($WaitTime);
include("webassist/email/waue_submissions_1.php");
$endtime = microtime_float();
$TimeTracker[] =$endtime - $starttime;
$RealWait = array_sum($TimeTracker)/sizeof($TimeTracker);
if ($LoopCount % $BurstSize == 0) {
$TimePassed = (time() - $StartBurst);
if ($TimePassed < ($BurstTime*60)) {
$WaitBurst = ($BurstTime*60) -$TimePassed;
wa_sleep($WaitBurst);
}
else {
$TimeRemaining = ($TotalEmails- $LoopCount)*$RealWait;
}
$StartBurst = time();
}
if (!$EnteredValue) {
$RecipArray[$RecipIndex][0] = mysql_fetch_assoc($RecipArray[$RecipIndex][1]);
}
}
$RecipIndex ++;
}
$_SESSION[$EmailRef."_Total"] = 0;
$_SESSION[$EmailRef."_Index"] = 0;
$_SESSION[$EmailRef."_Remaining"] = 0;
session_commit();
session_start();
if ($GoToPage!="") {
header("Location: ".$GoToPage);
}
}
?>



And you can look at my phpinfo() here:
phpinfo.php

Sign in to reply to this post

Jason ByrnesWebAssist

if you are getting a memory limit error, you need to increase the memory limit setting.

Sign in to reply to this post

jarrad407561

I'm not sure i'm allowed to increase the memory limit as it is shared hosting..
I reduced the post_max_size and upload_max_filesize to 64M instead, and tried a 25mb attachment and it has worked without errors. :)

Thanks for your help

Jarrad

Sign in to reply to this post

Jason ByrnesWebAssist

ok, glad to hear it is working.

Sign in to reply to this post

jarrad407561

It seems that 25mb file before was a fluke, it's still logging errors, I've had a few memory_limit errors, and since then i've upped it to 256M memory_limit, and i am still getting errors including memory_limit and internal server error..

I've abandoned the whole email attachment idea (why does it require so much memory?).. Instead i'm saving the attachments on the web server and sending a link to the file in the email..

Sign in to reply to this post

Jason ByrnesWebAssist

with larger files including a link is a better way to go anyway. some email hosts will not allow an attachment that large.

Sign in to reply to this post

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

Content

rating

Layout

rating

Ease of use

rating

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...