Jump to content
Sign in to follow this  
Kestralcontrols

Download a file using a "Hyper-link" in UniStream web server

Recommended Posts

Hi,
I'm trying to create a Web Server link to download a file stored on the SD card. I have tried copying the example shown in the help-file section "WE: Hyperlinks" but it returns an error "invalid URL address".
How do you covert the SD card path into a valid URL so that it will link the anchor text to the SD card file.

Kind Regards,
Sam

Share this post


Link to post
Share on other sites

Hi Kestralcontrols,
In order to download a file that stored on the SD card via a  web server "Hyper Link" use the prefix "ExternalSd" before the path to the file.

For example, lets assume the next file exist on my SD card "/MyDir/MyFile.txt". and that I have a "Hyper Link" widget that it "Tag:Link" is tag PATH_TO_FILE. If I will set PATH_TO_FILE to "/ExternalSd/MyDir/MyFile.txt" and press on the "Hyper Link" on the web site the file will be downloaded:

image.png
 

Share this post


Link to post
Share on other sites

Hi NoamM,
Thanks for the quick reply. I was using this method, but it kept failing. The problem was that the SD file structure on the card is not the same as it is shown on the HMI file browser.
I was trying to download a file that was located within the Data Tables directory. I assumed that  the directory was named "Data Tables" because that was what the file browser named the directory, but when I removed the SD card and read it, the real directory for storing Data Tables is named "DT"

When I changed the path to /ExternalSd/DT/08-18.scv instead of /ExternalSd/Data Tables/08-18.csv it worked.

Thanks again,
Sam

Capture.PNG

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×