Skip to main content
Participant
December 17, 2014
Question

Open files (PDF) located on a different server within a network?

  • December 17, 2014
  • 1 reply
  • 1402 views

I have a client that would like a button that will open a PDF document.

The PDF is located on another server volume than where the Flash projector file (EXE) will reside.

This is the code I would normally use for access a PDF that is located within the same folder structure of the EXE.

btnEquip.addEventListener(MouseEvent.CLICK, openPDF);

function openPDF(event:MouseEvent):void {

var url:String = "project\units\Training\Interactive\data\datasheet.pdf";

var request:URLRequest = new URLRequest(url);

navigateToURL(request);

}

I thought that Flash was limited to accessing files only within it's folder structure or from a web server.

Is it possible to access a file on another server volume?

The path the client is providing starts with \\

I assumed that a drive letter would need to be included.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 18, 2014

if you know the relative or absolute path to the pdf you should be able to use navigateToURL (as long as you you can accept that not all users will have default pdf viewers).

Participant
December 18, 2014


thanks kglad.

I found out that this is possible. What threw me off was documentation I found that stated paths on a windows operating system should use a \ (back slash). Other operating systems such as IOS should use a / (fwd slash).

This will be deployed on a windows system and the / (fwd slash) works, not the \ (back slash).

As long as I have the server volume, this works. It's too bad it's not easy to open the PDF directly in Acrobat. I've read the documentation regarding the use of the proxy.exe and a bat file but this project will have hundreds of PDF links.

kglad
Community Expert
Community Expert
December 18, 2014

i don't know why you would need a proxy file for this.

the pdf will open in the user's default pdf viewer.  i don't think there is anything you can do to specify that it open in acrobat which is probably a good thing because most users don't have acrobat installed on their computer.

now, if acrobat is installed on your server and you wanted to use it, that would be more complicated but should be doable.