size and extension for the uploaded files

  • Celia
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0

Celia created the topic: size and extension for the uploaded files

Hello,
we have a problem with the extensions and the size of the files that people upload in our application form. Some of them are able sending .doc or docx files etc and others get the message "file extension not allowed".

will you please tell me how to define the size and the extension of the files (.doc, .docx, .pdf, .jpg, .jpeg etc) we ask to be uploaded in our application form? Where should I look in order to define and increase or decrease the size and the extensions of the files?
How many MB can someone upload and how can I increase or decrease them if needed?

Thank you for your time
Celia
#226485
  • Posts: 2720
  • Karma: 92
  • Thank you received: 369

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

Hello,

For an upload element you can define allowed extensions in Advanced options of that element. Scroll down and you'll see Allowed file extensions field and there you write the extensions that you want submitter to be able to upload.

Regarding the filesize, if you are using HTML/Flash upload, go to Advanced options and in the HTML/Flash max. filesize in bytes (0 = no limit) write the maximum size that you want the submitter to be able to upload.

If you are not using HTML/Flash upload, please take a look at this article crosstec.org/en/support/online-documenta...e-before-submit.html .
Here it is explained how to define allowed file size.

I hope now everything is clear.
If you have more questions, feel free to ask.

Regards,

Mihaela
#226501
  • Posts: 264
  • Karma: 1
  • Thank you received: 31

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

Hi Mihaela.

I'm doing a file upload test for a member of my site who uses BF lite.

I prepared an upload form. If the file to load is greater than 1MB, it is rejected but I am redirected to the site's error page, not to the form page.

The site uses SEO and the form page is www.site.com/upload

Code in Submit pieces:
$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: upload&error=true");
//url to form = www.website.co/upload
}
Code in Before Form piece:
$this->execPieceByName('ff_initLib');
$show_error = JRequest::getVar('error');
if ($show_error == 'true')
{
     echo '<script type="text/javascript">alert("Fichier trop volumineux, Taille maximale acceptée 1Mo.");</script>';
}

What is my mistake?

Thank you for your help.
#234917
  • Posts: 2720
  • Karma: 92
  • Thank you received: 369

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

Hello,

After looking at your code I saw that you have set the location to:
header("Location: upload&error=true");
while in this piece of documentation crosstec.org/en/support/online-documenta...e-before-submit.html it is suggested to put the whole path to the form like:
header("Location: URLtoForm&error=true");

Please try to set the "Location" differently and let me know the result.

Regards,

Mihaela
#234921
  • Posts: 264
  • Karma: 1
  • Thank you received: 31

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

Hi Mihaela.

Sorry for my late response, I have not received notification of your message.
I've specified the absolute URL to the form, but an image larger than the specified weight will load anyway.

The image loading field is named "upload", the size in the script is set to 350000. If I fill in an image of 7 Mb, it loads without returning an error.

I will inscite to use a pro version of BF
#235098
  • Posts: 2720
  • Karma: 92
  • Thank you received: 369

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

Hello again,

I've tested the code with the following code:
$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) >= 576)
{
     // 1MB
     // set a custom error code
     $this->status = _FF_STATUS_UPLOAD_FAILED;
     // delete uploaded file
     unlink($filename);
     header("Location: http://localhost/joomla2/index.php?option=com_breezingforms&ff_name=fillselectfromtxt&ff_page=1&error=true");
}
For me it is working fine.

Please try to use this format for the form URL:
http://www.yourwebsite.com/index.php?option=com_breezingforms&ff_name=paypal_donation_form&ff_page=1

Let me know whether it worked.

Regards,

Mihaela
#235143
Moderators: ForumSupporttomeperica
Time to create page: 0.069 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