Checking duplicated files with "File upload" widget on Web Interface

196 views
Skip to first unread message

ciche...@fater.it

unread,
Sep 12, 2013, 10:18:00 AM9/12/13
to suppor...@runmyprocess.com
Hello,
using a "File upload" widget, is there a way to check if the user is uploading a duplicated file, that is, block the uploading if the file choosen has the same name of a file already uploaded ?

Should be used the "Validation" option in the widget ?
Is there any example ?

Thank you,
Luigi

Dimitri MELCHIOR Pro

unread,
Sep 15, 2013, 7:55:07 PM9/15/13
to RunMyProcess Support Forum
Hi Luigi,

There you will find a code example you must inject as pre-launch script of you Start/Update process button :

var upload = [[bozza_regolamento_file]];
var is_ok = true;


/* TO CHECK IF FILES ARE UPLOADED TWICE */

for (var i = 0; i<upload.length;i++){
 for (var j = i+1; j<upload.length;j++){
  if (upload[i].name == upload[j].name){
   alert('File name : "' + upload[i].name + '" è stato già caricato. Cambiare nome.');
   var is_ok = false;
   break;
  }
 }
 if (!is_ok){
  break;
 }
}

if (!is_ok){
 false;
}
else{
 true;
}

Best regards.

--

Dimitri MELCHIOR

PreSales Consultant

     

Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace

Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.



--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/dd815c36-3599-41e3-9bac-10d34ddbb982%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/groups/opt_out.

ciche...@fater.it

unread,
Sep 16, 2013, 9:57:51 AM9/16/13
to suppor...@runmyprocess.com
> Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace
>
>
>
>
>
>
> Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
>
> Be environmentally friendly: do not print this email unless it is entirely necessary.
>
>
>
>
>
> On Thu, Sep 12, 2013 at 4:18 PM, <ciche...@fater.it> wrote:
>
> Hello,
>
> using a "File upload" widget, is there a way to check if the user is uploading a duplicated file, that is, block the uploading if the file choosen has the same name of a file already uploaded ?
>
>
>
> Should be used the "Validation" option in the widget ?
>
> Is there any example ?
>
>
>
> Thank you,
>
> Luigi
>
>
>
> --
>
> Fujitsu - RunMyProcess
>
> ---
>
> You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
>
> To post to this group, send email to suppor...@runmyprocess.com.
>
> Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
>
> To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/dd815c36-3599-41e3-9bac-10d34ddbb982%40runmyprocess.com.
>
>
> For more options, visit https://groups.google.com/a/runmyprocess.com/groups/opt_out.

Thank you, Dimitri.
Is it also possible to run the script in Rules /Validation script of UPLOAD button ?
(so that user is blocked when clicking "upload" button, isn't it ?)

Luigi


Dimitri MELCHIOR Pro

unread,
Sep 16, 2013, 12:37:54 PM9/16/13
to RunMyProcess Support Forum
Hi Lugi,

No it is not possible because there is no validation rule for Upload button.

Nevertheless, you can :

1 - create a script that listens to variable_uploades

2 - Edit the script and return is_ok = "yes" or is_ok = "no" demending on the result of the function.

3 - You can set the upload widget validation rule as "[[is_ok]]" == "y"

Best regards.

--

Dimitri MELCHIOR

PreSales Consultant

     
Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace

Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.
Reply all
Reply to author
Forward
0 new messages