Absolute link to another workbook on the network - hyperlink

I currently have a excel workbook that has values being pulled from other workbooks in the same folder on the network.
Wherever this workbook is opened, the link to the workbook changes, and no longer works, as it stays relative to where you are opening it from. I need the path to point to the same place every time.
Example for where it should be pointing.
='\\1.1.1.1\intranet\lp\files\test\[metricsheet.xlsm]information'!$B$13
Is there a way to keep this path (absolute) without VBA?
Thanks!

='\\1.1.1.1\intranet\lp\files\test[metricsheet.xlsm]information'!$B$13
If the first part (1.1.1.1) is an ip address, you need two slashes. A single slash just refers to a directory, not a server.

Found out the issue. This path format does work.. however the relative path was matching the absolute path I wanted, as it was stored in the same folder. Moving it out and then copy/pasting the same path back in, caused it to stay.

Related

Where do I find a relative path?

I am trying to figure these out, but every single thing I read says exactly what I've already read in a previous article. I understand it theoretically, but I have no idea what how to write it into a code. I am such a noob and I need lots of help!
A relative path is the location of the file/folder relative to where you are. The absolute path is the full location. For example:
"C:\Product\Folder\SubFolder\file.exe" might be the absolute path of a file on your machine. But if you're already in C:\Product the relative path to that file would just be "Folder\SubFolder\file.exe". It's like knowing someone's full mailing address or knowing how to get to their house from yours. You may not need to know where you are in the world to know how to get from one place to another (your house to a coffee shop for example).
In code, you would use the absolute path if you're explicitly looking for a file at this location. But you may not always know the absolute location where your app is executing, and you are trying to access files that you control. In this case you only need to know how to get there based on where you are.
For example, My app may be installed at the following absolute paths "C:\Company\Product\app.exe" and my have had a library of files installed under that in the folder "C:\Company\Product\Files\". The absolute path may change if the user decides to install it in another location. But you still control the "Files" folder, so you would code the relative path of "Files\file.txt" to access it.
If you're still struggling with the difference. Think of the absolute path like the postal address of a chain store. Where every instance of that store is identical. The absolute path is the location of an item in a specific instance of that store (location of the store + location of item within the store). The relative path is just the location in the store. If the store were your app, or you were in a store, you don't really care where you are (which instance of the store you're in). You just need to know where the item is in the store. Relative path is knowing an item is in Row 2, second shelf from the bottom, third from the right. To you, it doesn't matter which store your in, you can still find it.

File Upload/Download Network Root Directory

Using ASP.Net MVC - AdoDB
Im used to upload and download from inside the webserver where I published my files
Server.MapPath("~/UploadedFiles/pdfDocuments/");
and it worked fine.
But now, I want to send them to another root outside the webserver, inside a network directory(shared folder). Need your help because I already tried this:
Server.MapPath(#"\\sharedfolder\UploadedFiles\pdfDocuments\");
Please help me on this. Ill appreciate.
I think you no longer need Server.MapPath at all. Its purpose is to map a relative / virtual path (e.g. an incomplete path such as ~/UploadedFiles/pdfDocuments/ into a full path to a file on disk, e.g. that string might get converted into C:\inetpub\wwwwroot\UploadedFiles\pdfDocuments, for example.
Since you are now using a UNC path (i.e. a path in the form \\server\share), this is already a fully qualified path to a resource. There is no missing information. Therefore in this situation MapPath has no purpose. You can simply remove the line which uses MapPath from your code, and pass your UNC path directly to your upload/download code.
Server.MapPath only works on relative and virtual paths. https://msdn.microsoft.com/en-us/library/ms524632(v=vs.90).aspx
If that is a valid path from you server us it directly.

Can I save the keep the absolute path of a file in database?

In my app I save some photos in sandbox and I keep its absolute path in database. Then I build and run again, I fetch the path and try to get the photo, it says the file doesn't exist.
At last, I found that every time I build and run my app, the path of app is different.
I use NSTemporaryDirectory() to get the temporary path, I run two times and get two results.
/private/var/mobile/Applications/80E09BB5-5FEB-4C27-935E-E29DE7861392/tmp/
/private/var/mobile/Applications/71427100-0DBF-42F0-B6B4-F88F6417292E/tmp/
Is it normal? When user updates my app, will the absolute path change?
If it's normal, should I just keep the relative path in database? Is there some best practice?
It's a very bad idea to store the absolute path in the database as any updates to the app results in the app being stored in a different folder within /private/var/mobile/Applications. During an app update, any files will be migrated across, however any references to them within the database will no longer be valid.
You must therefore always store the filepath relative to some other logical directory; for example the Documents or Caches folder.
This probably means you should store this path as a relative directory within your classes as well, and only resolve to an absolute path when you need to use it.
Finally storing temporary file references is probably a bad idea, as I believe any temporary or cached files can be removed from the filesystem by the O/S whenever it feels like it. Therefore you should store these files in the Documents folder, using the techniques I mentioned above.
You could save the file on server and store its physical path in database. I have built similar applications in past and that is how i used it. Might not be the right way but just a thought.
Is it normal?
Well, what is the meaning of temporary?
When user updates my app, will the absolute path change?
Well, what is the meaning of temporary?
If it's normal, should I just keep the relative path in database?
To do what with it?
Is there some best practice?
Don't use a temporary path for persistent storage. What about the documents folder?

What directory path to set in geoserver for Neo4j data source?

I have installed neo4j spatial in my Geoserver2.6 and now I am trying to see an example of a database.
I created in geoserver a workspace and then I want to add a new store. I select the neo4j store but then I don't know what to put in the field "Connection Parameters" (The directory path of the Neo4j database).
Till now I was using postgis, which you add the host name and the port.
What should I put in this field?
Any help will be mostly appreciated.
Thanks
D.
EDIT:
I found out that the directory path must have this form:
file:C:/Program Files/NEO4J_HOME/neo4j-community-1.9.9/data/graph.db/neostore.id
The path points to the neostore.id file inside the database.
The problem remains. Nothing happens when I select the save button in geoserver.
The original wiki that contained the answer to this was shut down a while back. But there is a copy at http://oss.infoscience.co.jp/neo4j/wiki.neo4j.org/content/Neo4j_Spatial_in_GeoServer.html. This is old information, but should still contain the answer you are looking for.

Fitnesse: Open file relative to current page

Is there a simple way to open a file from within a fixture, using a path relative to the current wiki page? The files are actually being stored in the same directory as the wiki page.
I'm using those files to store some expected data, that is later compared to the data actually measured while executing a test. Embedding the data in the wiki page would simply be too much.
I've already spent quite some time searching through the API, but couldn't find anything except how to access files in Fitness' root folder.
It would be simpler to store the files somewhere relative to the FitNesse root and put the relative path on the wiki page
|calculate some results|
|compare to expected at|relativepath|
To create/access pages path relative to the current wiki page use this syntax:
>RelativePage
> makes path relative from current page.

Resources