TOPIC:

Foto upload and reshow 1 week 4 days ago #256796

  • Topic Author
  • Niederhofer
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 72
  • Thanks: 0
Hi Tihana,
do you have any news for this topic?

Thanx and kind regards
Andreas

Please Log in or Create an account to join the conversation.

Foto upload and reshow 1 week 4 days ago #256811

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 4862
  • Karma: 3
  • Thanks: 349
Hi,

in your previous topic you want only one uploaded foto saved (e.g. if someone upload foto1 twice, only one foto1 will be saved)->in this topic I put the code.
crosstec.org/en/forums/1-forums/129716-foto-upload-update.html

Also, instead of this(the code from previous topic) you can add this code in Begin Submit pieces (your form->Advanced->More options->Submit pieces->Begin submit->check Custom and put):
$this->execPieceByName('ff_InitLib');
$filename = ff_getSubmit('upload');
if ( file_exists($filename))
{
    
     // set a custom error code
     $this->status = _FF_STATUS_UPLOAD_FAILED;
     $this->message = BFText::_('COM_BREEZINGFORMS_PROCESS_FILEEXISTS');
     unlink($filename);
     header("Location: URLtoForm&error=true");
     
}
Change URLtoForm to the URL that links to the url of your form. Don't change '&error=true'

Then go to your form->Advanced->More options->Form pieces->Before form check Custom and put:
$this->execPieceByName('ff_initLib');
$show_error = JRequest::getVar('error');
if ($show_error == 'true')
{
     echo '<script type="text/javascript">alert("Error_Message");</script>';
}
Change 'Error_Message' to your desired error message.
Now the form should redirect the user to the form and show a PopUp message.

With this code you will have only one foto1 (for example) saved, and error message will be shown.

I hope I explained it well

Let me know if you get stuck somewhere that I can help to you :)

Best regards,
Tihana

Please Log in or Create an account to join the conversation.

Foto upload and reshow 1 week 4 days ago #256826

  • Topic Author
  • Niederhofer
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 72
  • Thanks: 0
Thanx a lot for your effort, but I am not sure, whether this is the solution. I am looking for a way to let the user know, which pics he/she already uploaded in the session before. They are allowed to upload 3 pics max and also the user can reload the form a second, third,...time to fill in new data and update the form.

But then after reload, there is no information, which pictures and how many they have uploaded before. Just the plain file upload buttons.

So I want to insert somewhere the custom information like "you have already uploaded XXX.jpg as photo#1, YYY.jpg as photo#2 before . When you upload other photos, then these will delete the ones before" (as now we have only one foto1, one foto2,...in the upload folder)
The file names "XXX.jp", "YYY.jpg" should written into the db while uploading at the first session. For the following session these name data should be grabbed from the db and then dynamically inserted into this info text for this individual user.

Does this makes sense, how I explained?

Please Log in or Create an account to join the conversation.

Foto upload and reshow 1 week 4 days ago #256836

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 4862
  • Karma: 3
  • Thanks: 349
Hi,

yep, give me some time for testing

P.S: today we work part time but I will try to finish before the end of working hours

Regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.047 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!