size and extension for the uploaded files

  • Posts: 264
  • Karma: 1
  • Thank you received: 31

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
  • Posts: 2720
  • Karma: 92
  • Thank you received: 369

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: 264
  • Karma: 1
  • Thank you received: 31

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
  • Posts: 2720
  • Karma: 92
  • Thank you received: 369

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
  • Posts: 2
  • Thank you received: 0

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

Hello Mihaela, good afternoon.
I have a similar problem with the size check of uploaded file.
I work with Joomla 3.9.12 and BF free.
I created a upload element for pictures, just set the allowed pictures extensions and left other settings as default.
I used the suggested strings (copy-paste) in

crosstec.org/en/support/online-documenta...e-before-submit.html
and just changed

- Begin Submit Piece
> 'upload' with the fieldname of the upload element
> URLtoForm with the link to the first page of the form

- Before Form Piece
> 'Error_Message' with my desired message

Moved to form advanced settings and updated the Form Pieces & Submit Pieces settings with the new ones.

Unfortunately it does not work, just uploading the files >1Mb without problems or messages.

Something I have missed or I could change for solving this issue?
Do you need additional information from my side?

Thanks, bye

Andrea
#238177
  • Posts: 2
  • Thank you received: 0

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

Good morning All,
nobody can help?

Thanks for your support :)

Bye
Andrea
#238262
Moderators: ForumSupporttomeperica
Time to create page: 0.076 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

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 and icon packs!

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