# Unable to open network files anymore via system.net.openURL

**URL:** <https://forum.inductiveautomation.com/t/unable-to-open-network-files-anymore-via-system-net-openurl/10796>\
**Category:** Ignition\
**Created:** [November 16, 2015, 6:15pm UTC](https://forum.inductiveautomation.com/t/unable-to-open-network-files-anymore-via-system-net-openurl/10796 "2015-11-16T18:15:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimmylooo](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jimmylooo](https://forum.inductiveautomation.com/u/jimmylooo)\
**Post date:** [November 16, 2015, 6:15pm UTC](https://forum.inductiveautomation.com/t/unable-to-open-network-files-anymore-via-system-net-openurl/10796/1 "2015-11-16T18:15:38Z")

</div>

Did something change with system.net.openURL in 7.8??

After upgrading to 7.8 we can no longer open network files.

Here is the existing code: (This code worked in 7.7)

```auto
f= '//srv-01/share/_NGB Work Orders/RS20141120-04/Attachments/VesselInventoryError.png'

if system.file.fileExists(f):
	fileToOpen = "file:///" + f
	system.net.openURL(fileToOpen)
```

Any help would be great. The Ignition Help doesn’t explain any of this.

---

<div class="post-metadata">

**Author:** ![jimmylooo](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jimmylooo](https://forum.inductiveautomation.com/u/jimmylooo)\
**Post date:** [November 16, 2015, 6:57pm UTC](https://forum.inductiveautomation.com/t/unable-to-open-network-files-anymore-via-system-net-openurl/10796/2 "2015-11-16T18:57:32Z")

</div>

I think i figured it out. I think in 7.8 it deals with spaces in file paths differently.

Looks like now you need to replace spaces with ‘%20’

So this:  
‘//srv-01/share/\_NGB Work Orders/RS20141120-04/Attachments/VesselInventoryError.png’

Should be This:  
‘//srv-01/share/\_NGB%20Work%20Orders/RS20141120-04/Attachments/VesselInventoryError.png’

Oh and be sure to preceed the above with ‘file:’ so your code would read like this:

system.net.openURL(‘file://srv-01/share/\_NGB%20Work%20Orders/RS20141120-04/Attachments/VesselInventoryError.png’)

---

<div class="post-metadata">

**Author:** ![jimmylooo](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jimmylooo](https://forum.inductiveautomation.com/u/jimmylooo)\
**Post date:** [November 16, 2015, 8:02pm UTC](https://forum.inductiveautomation.com/t/unable-to-open-network-files-anymore-via-system-net-openurl/10796/3 "2015-11-16T20:02:17Z")

</div>

Some code that works pretty well:

```auto
def open(filePath):
	# **** Note: This will error out if the path is like this: \\server\folder\file.ext python does not play well with '\'s
	#First Look to see if the file is on the local PC/Mapped drive or a fileshare(NFS) Path and build path prefix:  
	# For Local or Mapped drives path prefix should be: file:///
	# For Fileshare(NFS) paths prefix should be: file:
	prefix = ''
	path = ''
	if ':' in filePath:
		prefix = 'file:///'
	else:
		prefix = 'file:'
	print filePath
	#now make sure slashes are correct:
	if '/' in filePath:
		path = filePath
	else: #only if the path is like so \\\\server\\folder\\file.ext
		path = filePath.replace('\\','/')  	

	#now make sure spaces in the path are accounted for with %20 instead:
	path = path.replace(' ','%20')
	
	#Open the File
	system.net.openURL(prefix+path)
```

Enjoy!

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [November 16, 2015, 10:13pm UTC](https://forum.inductiveautomation.com/t/unable-to-open-network-files-anymore-via-system-net-openurl/10796/4 "2015-11-16T22:13:45Z")

</div>

Hi James,

Thanks for posting this code. It really helps if you put it in ` blocks so we can see the indenting `

---

<div class="post-metadata">

**Author:** ![jimmylooo](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jimmylooo](https://forum.inductiveautomation.com/u/jimmylooo)\
**Post date:** [November 17, 2015, 12:13pm UTC](https://forum.inductiveautomation.com/t/unable-to-open-network-files-anymore-via-system-net-openurl/10796/5 "2015-11-17T12:13:32Z")

</div>

Al,

Thanks for the tip. 🙂
