🎉 🎉   RAPIDMINER 9.5 BETA IS OUT!!!   🎉 🎉

GRAB THE HOTTEST NEW BETA OF RAPIDMINER STUDIO, SERVER, AND RADOOP. LET US KNOW WHAT YOU THINK!

CLICK HERE TO DOWNLOAD

🦉 🎤   RapidMiner Wisdom 2020 - CALL FOR SPEAKERS   🦉 🎤

We are inviting all community members to submit proposals to speak at Wisdom 2020 in Boston.


Whether it's a cool RapidMiner trick or a use case implementation, we want to see what you have.
Form link is below and deadline for submissions is November 15. See you in Boston!

CLICK HERE TO GO TO ENTRY FORM

Upload file using a Rapidminer Server Web App

Edin_KlapicEdin_Klapic Moderator, Employee, RMResearcher, Member Posts: 267  RM Data Scientist
edited November 2018 in Knowledge Base

Question

How can I upload a file (e.g. an Excel file) from my computer and process the results directly in RapidMiner Server?

Answer

Here is what you need:

 

  • RapidMiner Server up and running
  • The Text processing extension (on Server and on Studio)
  • Being able to create a Webservice from a RapidMiner process. See article How to create a webservice for details.

 

The solution in short:

 

  1. Create an HTML form which includes an input tag with type="file" and display it as a Web App visualization component
  2. Send the file via HTTP-Post to a RapidMiner process which has been published as a web service
  3. Store / Process the file and provide a success message

 

The solution in detail:

 

 

Spoiler

Hint

Using the special user "anonymous" makes the functionality much more convenient. This way the user who uploads the file does not need to reauthenticate himself for the upload. Therefore "anonymous" needs to have at least permission to execute within the folder in which the described processes are stored. See article Create and Manage "Special Users"  for further information.
In this case you need to grant the user anonymous the execute permissions for the folder where the processes are stored. If you want to store data, the user also needs the permission to write.
In addition you need to adapt the action URL. You need to include the keyword "public" between "rest" and "process" (http://localhost/api/rest/public/process/<web service name>)

 

  1. Create a folder in which you want to store the processes (and uploaded data if you wish) on the server.
  2. Now create the process which receives the uploaded file and processes it. The attached example process "Read file from web app - webservice" receives either one or two excel file(s) and stores them in the repository. Then it sends a success message.
  3. This process needs to be exported as webservice as described in the article How to create a webservice. Make sure that you have set the Output format to "HTML" and the MIME Type to "text/html".
  4. Create the process displaying the HTML form and set the Webservice URL as the value for the form "action" (see attached example process).
  5. Create the Upload component as "New visualization" component in your RapidMiner Server Web App.
  6. Make sure that you have set the Output format to "HTML" and the MIME Type to "text/html".

 

 

What are constraints of this feature?

  • If you enable the upload of multiple files at once (by using the keyword "multiple" in the HTML tag for the the input type="file") and you want to store them as one exampleset you have to ensure that the structure of the uploaded files is the same.
  • You can only upload as many files at once as you have input ports connected.
  • The operator "Publish to App" does not work in webservices since it is executed in a different session.

 

 Edit (2016/12/15):

I just uploaded new process versions which already store each uploaded file with the original name as well as the full file.

The webservice now also makes use of the Handle Exception Operator which helps you to deal with problems.

Edit (2016/12/16):

I just uploaded a new process version for the HTML form. It includes a version of the HTML form with which you can rename the file(s) you upload. Only works for single file uploads.

 

Output of example process "Read file from web app - HTML form"

 

Upload Component.PNG

 If you have selected a file for upload - the name is displayed

 

Upload Component - file selected.PNG

 

 Success message (output of the example process "Read file from web app - webservice")

 

Upload Component - success.PNG

sgenzeryyhuangPavithra_Rao

Comments

  • sgenzersgenzer 12Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,525  Community Manager

    This is GREAT.  Thank you so much for posting this.  I have just installed it and it works very well.  One small question - how can I pass the Excel file name into the process so that it stores the data set using this name, rather than the "Uploaded file".  Or, even better, can there be a small dialog box that asks for the name for the new data set? before Start Upload?

    ----------------------
    Don't forget to submit your great ideas for Wisdom 2020! Deadline is November 15.

    Wisdom 2020 – Call for Speakers Form 

  • Edin_KlapicEdin_Klapic Moderator, Employee, RMResearcher, Member Posts: 267  RM Data Scientist

    Glad I could help. :)

     

    I just uploaded new versions of the processes which store the original files as repository examplesets and the full (i.e. appended) file.  :)

     

    Including a dialog box should be possible in the HTML form. I will check and let you know, how this can be achieved.

     

    Best,

    Edin

     

     

  • icsd11159icsd11159 Member Posts: 16  Maven

    Hello,

    thank you for your post! But i face a problem . I paste the Embeddable HTML Code in action (html app) but when I test the web app - webservice.rmp with web service(RM Server)i get error: 

    de.rapidanalytics.ejb.service.ServiceDataSourceException: Error executing process /home/admin/Read file from web app - HTML form.rmp for service newServiceupload: The dummy operator Create Document (replacing text:create_document) cannot be executed.

    and nothing is work !

    Thank you in advance

  • sgenzersgenzer 12Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,525  Community Manager

    hello @icsd11159 so when you get a "dummy operator" that means that RapidMiner does not recognize the operator. In this case it is highly likely that the Text Processing extension is not installed on your server.

    ----------------------
    Don't forget to submit your great ideas for Wisdom 2020! Deadline is November 15.

    Wisdom 2020 – Call for Speakers Form 

  • icsd11159icsd11159 Member Posts: 16  Maven

    Thnak you for your reply!

    I try to add the extension in System Settings like thisex.PNG

    But nothing is change.

  • sgenzersgenzer 12Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,525  Community Manager

    Hello @icsd11159 - yes that's not correct. Here's the link to documentation on installing extensions on Server: https://docs.rapidminer.com/latest/server/administration/installing-extensions.html

     

    Scott

     

    ----------------------
    Don't forget to submit your great ideas for Wisdom 2020! Deadline is November 15.

    Wisdom 2020 – Call for Speakers Form 

Sign In or Register to comment.