size and extension for the uploaded files

  • Posts: 158
  • Karma: 1
  • Thank you received: 14

Eddy.vh replied the topic: size and extension for the uploaded files

Hi Mihaela.

Thank you for your appreciated response.
Indeed, with the link in its non-SEO form, the redirection works well.
But once on the error page, loading an image under the maximum weight still works but we stay on the same page with the error message that appears again.
#235157
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2360
  • Karma: 85
  • Thank you received: 316

mihaela replied the topic: size and extension for the uploaded files

Hello again,

Please in the Begin Submit piece please try to add this piece of code at the end:
    else {
 header("Location: http://www.yourwebsite.com/index.php?option=com_breezingforms&ff_name=paypal_donation_form&ff_page=1&error=false");
}
NOTE: Don't forget to adjust the url for your form.

So, the whole code should look like this:
$this->execPieceByName('ff_InitLib');
// get the name of the uploaded file element
$filename = ff_getSubmit('upload');
// check size of uploaded file
if ($filename && filesize($filename) >= 1048576)
{
     // 1MB
     // set a custom error code
     $this->status = _FF_STATUS_UPLOAD_FAILED;
     // delete uploaded file
     unlink($filename);
     header("Location: http://www.yourwebsite.com/index.php?option=com_breezingforms&ff_name=FORMNAME&ff_page=1&error=true");
}
    else {
 header("Location: http://www.yourwebsite.com/index.php?option=com_breezingforms&ff_name=FORMNAME&ff_page=1&error=false");
}

Let me know whether that resolves the issue.

Regards,

Mihaela
#235176
  • Posts: 158
  • Karma: 1
  • Thank you received: 14

Eddy.vh replied the topic: size and extension for the uploaded files

Hi Mihaela

Yes, it works perfectly.
Sometimes when we read the solutions we said we could have done it by ourselves.
Thank you very much for your precious help.

Regards.
#235182
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2360
  • Karma: 85
  • Thank you received: 316

mihaela replied the topic: size and extension for the uploaded files

Hello again,

Thank you for the kind words.

I'm glad I've helped and that it is now working as you wanted.

Yes, sometimes the answer is simple, but it doesn't always cross our minds. :)

Regards,

Mihaela
#235184
The following user(s) said Thank You: Eddy.vh
Moderators: ForumSupporttomeperica
Time to create page: 0.071 seconds

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans & templates!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here