Upload HTML5

  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2791
  • Karma: 95
  • Thank you received: 376

mihaela replied the topic: Upload HTML5

Hello again,

The files that manage the HTML5 upload are:

root/administrator/components/com_breezingforms/libraries/crosstec/classes/BFQuickMode.php and root/components/com_breezingforms/facileforms.process.php .

Good luck with the tests, I hope you will manage to do something.

Regards,

Mihaela
#237131
  • Eddy.vh
  • Eddy.vh's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 269
  • Karma: 1
  • Thank you received: 34

Eddy.vh replied the topic: Upload HTML5

Mihaela.

Another question before playing the sorcerer's apprentices.
If we can not delete the preloaded corrupted image, if exceeded, could we at least reload the form to reset it? This would force the user to fill in his complete information again.

Thank you very much.
#237132
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2791
  • Karma: 95
  • Thank you received: 376

mihaela replied the topic: Upload HTML5

Hello again,

I think I have come to a solution! :)

I've tested it and as far as I can see it is working fine.

Please go to form's Advanced pieces > More options > Submit pieces and in Begin Submit section set Type to Custom and paste in this code:
$this->execPieceByName('ff_InitLib');
// get the name of the uploaded file element
$filename = ff_getSubmit('upl1');
// check size of uploaded file
if ($filename && filesize($filename) >= 60500)
{   
     unlink(ff_getSubmit('upl1'));

$i = 0;
foreach($this->savedata as $data){
    if($data[_FF_DATA_NAME] == 'upl1'){
         $this->savedata[$i][_FF_DATA_VALUE] = "";
         break;
   }
   $i++;
}
 
}
NOTE: In the code above replace all three instances of 'upl1' with the name of your HTML5 upload field.

Besides that, you have to replace 60500) with the max wanted file size.
Put that same maximum in the Advanced properties of the HTML5 upload filed as "HTML5/Flash max. filesize in bytes (0 = no limit)".

I've tested this behavior for when the "Allow multi HTML5/Flash uploads" is not checked, so only one upload is allowed at the time.

Please test this yourself and let me know whetehr it works for you.
From my testing, it seems to be working fine.

Regards,

Mihaela
#237133
  • Eddy.vh
  • Eddy.vh's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 269
  • Karma: 1
  • Thank you received: 34

Eddy.vh replied the topic: Upload HTML5

Mihaela.
Always with good news.
I test this solution and come back to share my results.

thank you for your help
#237135
  • Eddy.vh
  • Eddy.vh's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 269
  • Karma: 1
  • Thank you received: 34

Eddy.vh replied the topic: Upload HTML5

Mihaela.

Unfortunately, it does not work.
The file too heavy when it is chosen on the hard disk is refused but a part is loaded, as if it was loaded in a memory, and what is loaded is a size well below the limit ... So when submit, this end corrupted file is transmitted.

My upload field HTML5 (not multi) name : upload

The script in submit piece :
$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) >= 150000)
{   
     unlink(ff_getSubmit('upload'));

$i = 0;
foreach($this->savedata as $data){
    if($data[_FF_DATA_NAME] == 'upload'){
         $this->savedata[$i][_FF_DATA_VALUE] = "";
         break;
   }
   $i++;
}
 
}

Select an image file that is too big, it returns the error message, selects a file of good size and valid, 4 times out of 5 the two are loaded, one of which is corrupted.
#237137
  • Eddy.vh
  • Eddy.vh's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 269
  • Karma: 1
  • Thank you received: 34

Eddy.vh replied the topic: Upload HTML5

If I leave the upload field without limit, the form is sent but the file is not loaded.
But in this case we do not have an alert message.
#237138
Moderators: ForumSupporttomeperica
Time to create page: 0.071 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