Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Processing Post Data, Form Data, and Uploaded Files (Real-Time, Windows)

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Parent Topic: Developing HTTP Method VIs

When a web client sends an HTTP request to a Web service, the Web service accepts the request and routes it to the HTTP method VI specified in the URL. That HTTP method VI uses the connector pane and VIs on the Web Services palette to process the request and return a response. A web client might send data by appending values to a URL or by using standard HTML forms configured for HTTP methods such as POST.

Note  For more information about concepts in this topic, refer to the Web services introduction and tutorial. LabVIEW Web services are available only in the LabVIEW Full Development System and the LabVIEW Professional Development System.

Configuring the HTTP Method VI

To configure an HTTP method VI to accept post data, set its HTTP method as POST. Right-click the VI in the LabVIEW project and select POST.

Developing the POST HTTP Method VI

If a web client submits a URL with values that correspond directly to controls of the HTTP method VIs, you can use the connector pane to route the values to the controls. For more advanced data, you can use the VIs from the Web Services palette to process the data from the web client's request. Use the following VIs to accept form and post data:

You must wire a LabVIEW Web Service Request control to the connector pane of any HTTP method VI that receives post data and includes VIs from the Web Services palette.

Accepting Uploaded Files from a Web Client

LabVIEW stores information about each file uploaded by a web client in an array of clusters. The information for each uploaded file includes the client filename, the path to the temporary location, the content type, and the size (bytes). When you develop HTTP method VIs, include the Read Uploaded Files Info VI to return information regarding all uploaded files associated with an HTTP request. Use this information to perform actions on the uploaded files, such as moving them to a permanent location.

You must wire a LabVIEW Web Service Request control to the connector pane of any HTTP method VI that receives uploaded files and includes the Read Uploaded Files Info VI.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit