Jump to content

Recommended Posts

In this topic I was helped to understand how to use the HTTP Client VIs to connect to a HTTPS server.

I have manged to use those Client VIs to gather sufficient (dynamic) information from the server to form the dynamic download links for a series of CSV data files that the server can provide. The HTTP Client VIs seem to me to be able to only return web page header and body information. I have not found a way to use them to grab a file specified by a URL. Is there a way to do this with them? The HTTP Client VIs make use of "Client Handle" RefNums to identify the open connection. Are there other VIs available in the VI library that can also use these same Client Handles and which can transfer a file?

Thanks!

Link to post
Share on other sites

I had tried feeding the URL (URI?) for the target CSV file to GET.VI and all I got in response was a "you are being redirected" in the "body" return string (or else the designated file if I passed a file name to GET). If GET truely is the correct way to do this then I guess I need to revisit my methods of producing the request...

Thanks.

Link to post
Share on other sites

It turned out that the problem was a slightly misformed URL.

GET does indeed return the requested file in the "body" string if no path is attached to GET and it drops it into the file if a valid path is provided.

Thank you again Shaun!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By kingcobraninja
      Ok anyone who can manage to contain their laughter for a minute, help me out with this.
      I need exactly what's in the title. Due to the deprecation of TLS1.0 and SSL3, we're disabling both on our web server that receives status information from hundreds of systems across the country via HTTPS. Some of the systems run Windows 7, some Windows XP. All of them run applications built in LV 2012sp1.
      In the past we've used the NI HTTP client VIs, which work well, and still work for some (?) Win7 systems. They don't work for the Windows XP systems. Are these VI's just a wrapper for the OS's HTTP client (IE)?
      We've also been down the .net WebRequest path, but from what I can tell the webclient class doesn't support any security protocols past TLS1.0, at least not in .net 2.0, and the HTTPClient class wasn't introduced until .net 4.5, which LV doesn't support, at least not in 2012 sp1.
      Lastly, we're considering the Encryption Compendium being offered in the JKI package manager, but it's 629 pounds, and if there's a way to do this without it, it would be preferred.  Also we're not sure it would work with the given constraints.  Has anyone used it/know anything about it?
      Any help is appreciated.
    • By GregFreeman
      Edit: found this in context help: Arrays and strings in hierarchical data types such as clusters always include size information.
       
      http://forums.ni.com/t5/LabVIEW/Write-to-Binary-File-Cluster-Size/td-p/3199224
       
      I have a cluster of data I am writing to a file (all different types of numerics, and some U8 arrays). I write the cluster to the binary file with prepend array size set to false. It seems, however, that there is some additional data included (probably so LabVIEW can unflatten back to a cluster). I have proven this by unbundling every element and type casting each one, then getting string lengths for the individual elements and summing them all. The result is the correct number of bytes. But, if I flatten the cluster to string and get that length, it's 48 bytes larger and matches the file size. Am I correct in assuming that LabVIEW is adding some additional metadata for unflattening the binary file back to a cluster, and is there any way to get LabVIEW to not do this?
    • By Hack4Life
      Hello,
      I need to select a .csv file which has two integers seperated through a comma per line. I have to sume these to values and write it to a new .csv file with the two integers and as third position the result. I have a path selector and a read from spreadsheet and a write to spreadsheet element. But I do not know how to read the two values line per line and add those to values with the result in a new .csv file. 
       
      For example:
      input:
      A,B 1,3 2,6 3,3 output:
      A,B,C 1,3,4 2,6,8 3,3,6 I hope that somebody can help me.
       
      Thanks for your help!
      Greets from Austria,
      Fabian
    • By Manudelavega
      Hi,
       
      I can't get my head around this issue. Let me lay out the scene:
       
      My application logs data in a .csv file. The file is created with R/W permissions through the "Open/Replace/Create File" VI.  Then it uses the "Write to Binary File" to log the data, keeps the reference opened all along, and only close the file at the end.
       
      So far everything works perfectly. If I double click on the file in Windows Explorer, Excel sees that the file is being opened in LabVIEW and shows the typical message giving me the following choice: Read-only, Notify, or Cancel. If I cancel, Excel closes and things keep on going fine.
       
      However, if I do click "Read only", the "Write to Binary File" function in my LabVIEW application throws an error 8: File permission error. Somehow opening the file as read-only in Excel steals the write permission of LabVIEW.
       
      Have you ever experienced this? What could be happening?
       
      Emmanuel
    • By smarlow
      Hello:  I am wondering if anyone has developed a VI to convert image data from the "Get Image" method to a PNG format string.  I do not need compression or filtering and will only store RGB (24-bit), or paletted 8-bit (optionally, but not required).  The trouble I am having is that the "write PNG file" and "LV Image to PNG" VI's are not supported in real-time.  The BMP file writer works, but is not really a web format.  I suppose I could write one, but I am under the gun on a project, and don't want to reinvent the wheel.  Thanks.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.