LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you return to a webpage after uploading file by a form in LabVIEW Web Services

Solved!
Go to solution

I am using the code from https://forums.ni.com/t5/LabVIEW/Upload-file-with-LabVIEW-webservices/td-p/3172070 to upload a file to a LabVIEW web service. After submitting the form, in the browser window, I received the response 

 

{"PermaPathArray":["C:\\Users\\Public\\Documents\\IMG_9416.JPG"],"size(s)":1,"TempPathArray":["C:\\Users\\XXXX\\AppData\\Local\\Temp\\2B37UAKR66T72V8A\\WebServices\\temp\\tmp4_3_1.tmp"]}

 The file is uploaded to the data server, but I am unsure of how to proceed from here, as the browser is now viewing

 

                 http://127.0.0.1:8001/MyWebService/upload

 

instead of the sending HTML file http://127.0.0.1:8001/MyWebService/upload.html. 

 

 I have also tried something similar using a Fetch command in JavaScript with a POST method but get the same response.

 

Any help would be greatly appreciated.

0 Kudos
Message 1 of 3
(730 Views)

Need to reply with a redirect status (307 probably most likely) and set a header value of the location to redirect to.

~ The wizard formerly known as DerrickB ~
Gradatim Ferociter
Message 2 of 3
(666 Views)
Solution
Accepted by topic author hekdude

It is a 301 response code on the Set HTTP Redirect.vi with the link to the web page you want to go to after processing.

 

Thank you for your help with this.

0 Kudos
Message 3 of 3
(649 Views)