Expand my Community achievements bar.

Link to File

Avatar

Former Community Member
Thanks for taking the time to read my question.



I have a form on which I'd like a link to a file on a server. I don't know how to do that, as all that is availalble are buttons that have pre defined functions. I don't want the file to open in the form window, but in a new window.



I've tried using an HTTP Submit Button and have the link file://///servername/foldername/filename but it's not working.



Any ideas on how to accomplish this?



Thanks again,



Brad
4 Replies

Avatar

Former Community Member
Try the following JavaScript on a button click:



app.launchURL("file://servername/foldername/filename", true);



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
I tried using this code, and I couldn't get it to work on my form. Anyone else have luck for this? I have the same issue, and can't get the click code to launch my index.htm. Any suggestions?



Here is the code I used:



app.launchURL("file://adddalw05/EmaHP/S04_17/index.htm", true);



I can open a browser and get to my HTML file through \\adddalw05\EmaHP\S04_17\index.htm, but not through my button with the above script on the click event.



Thanks for any help!

Jay

Avatar

Former Community Member
Well, two things. "\\adddalw05\EmaHP\S04_17\index.htm" looks like a UNC path, where you're saying get file index.htm from directory S04_17 in share EmaHP on machine adddalw05. "file://adddalw05/EmaHP/S04_17/index.htm" is a relative file URL, which will look for directory adddalw05 off of the current working directory.



In any case, it looks like there are security limitations I wasn't aware of and you cannot use file URL's in app.launchURL() unless the PDF is certified by a trusted source. So, you'll need to host the file on a webserver and use the http URL to it in the app.launchURL() call.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Thanks Chris,



I believe you are correct. There is some security limitations, and I think that is my problems. I will have to publish my file on an IIS web published server location.



Thanks so much for the quick response!



Cheers!

Jay