Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This sample demonstrates a file upload/download/preview application with the use of several features available in the WSO2 Data Services ServerWSO2 Enterprise Integrator (WSO2 EI). Some notable functions are listed below.

...

By combining functionality of the above queries, we can create a sample file management system with the use of data services. See About Data Services and Resources for a definition of data services, queries and operations.

...

The sample data service, FileService should be deployed using the instructions in Samples Setup.

Running the sample

To execute the application, you have to run the ant file_service_app command as described in the Data Services Clients section. 

  • Uploading files
    When uploading files, after a file is selected to be sent, the file is read and the data is transferred in chunks to the server. Figure below shows a file upload in progress.
     
  • Downloading files
    Select a file you want to download from the file list and press download. After selecting the path to be saved, the file data is retrieved from the server and saved on the local disk. When the user clicks download, the data download starts immediately as indicated by the progress bar. This is possible because of the data streaming capability of the WSO2 Data Services Server.
     
  • Previewing files
    Images can be previewed using this application. Select an image file and click Preview. The image is downloaded to memory and shown in the preview panel:
     
  • Deleting files
    To delete a file from the server, select the file name from the list and press Delete. This invokes a data service operation and removes the file from the database.