relative-path

Rails redirect with https

Hi everyone, I'm maintaining a Ruby on Rails site and I'm confused as to how to perform redirects to relative URLs using the https protocol. I can successfully create a redirect to a relative URL using http, for example: redirect_to "/some_directory/" But I cannot discern how to create a redirect to a URL using the https protocol. I...

Namespace-respecting relative import in Python

I have this folder structure: package/ __init__.py misc/ __init__.py tools.py subpackage/ __init__.py submodule.py I am in submodule.py, and I would like to import misc.tools. I don't want to use absolute import to import package.misc.tools, because then my package would only work when it's ...

Dreamweaver changing path to site's reference instead of local

I have noticed recently, when I apply a template to a new HTML website, all the relative paths are pointed to my local files, example: file:///C|/webstuff/files but I cannot set them to relative paths that are pointed to my server, http://www.websitehere.com/ I have read that some versions of Dreamweaver will not allow this, can anyone c...

virtual paths - breaking images/links?

I am working on an ASP.NET website, and I am puzzled by the behavior that occurs only when I am using localhost or if my website resides inside another website in IIS. I have virtual path as in I could have something like mywebsitefolder\category\category1.aspx when the folder category does not even exist in first place by using url re...

Zend_framework - relative paths of images

When i am developing a web application on Zend_framework (php) i have to include images (css files, js files, etc). The solution for inclusion was to specify the absolute paths each time i needed an image (i was storing in "global like" parameter with my host and concatenated it with the relative path of the image on the host). As i un...

Attaching a stylesheet with dirname(__FILE__) won't work even though the file is there.

Hi. I have a PHP class that creates a header for my html file.. It's included, and that file is included again.. So I thought that the dirname(__FILE__) function could work.. But it says it can't find the stylesheet.. I'm using mamp on os x, and when I take the path that I get from dirname(__FILE__)./../stylesheets/stylesheet.css into t...

Alternative ways to get a full path of a file

Is there any alternative way to get a full path of a file without using Path.GetFullPath method? ...

Firefox: Can I use a relative path in the BASE tag?

I have a little web project where I have many pages and an index/ToC file. The toc file is at the root of my project in toc.html. The pages are spread over a couple of subdirectories and include the toc with an iframe. The project doesn't need a web server, so I can create the HTML in a directory and browse it in my browser. The problem...

Make ~/ reference the root folder (the same folder as web.config is in)

Hi, I'm working on a site in asp.net (my first) which is all going very well. That is until I deployed the app to our test environment, where the ~ (tilde) started referencing a folder parent to the root of my project. On my computer the app lives in c:/Documents.../Visual Studio../WebSites/MyApp and ~ resolves correctly. On the test ...

Get relative path to image

I wrote a javascript method to display an image dynamically depending on whether or not a plugin is installed or not. Depending on the page, the url might be deep into sub paths and i wanted to see if i can get a path back to the image without all the marky-mark. Example myImage src location = {root}/Content/Images/myImage.png Now cal...

Accessing files in the same directory as script

I need to access files that are relative to the location of my Ruby script. The only solution I've found is using File.dirname(__FILE__), however, if the script is run from a symlink, __FILE__ gives the location of the symlink. I would prefer a solution that does not involve looking at __FILE__, checking if it's a link, if it is, findi...

In C#, how do I combine more than two parts of a file path at once?

To combine two parts of a file path, you can do System.IO.Path.Combine (path1, path2); However, you can't do System.IO.Path.Combine (path1, path2, path3); Is there a simple way to do this? Edit: I ended up using Aaron's helper method, but simplified it with Kha's advice: public static string CombinePaths (params string [] paths) ...

Convert a Relative URL to an Absolute URL in Actionscript / Flex

I am working with Flex, and I need to take a relative URL source property and convert it to an absolute URL before loading it. The specific case I am working with involves tweaking SoundEffect's load method. I need to determine if a file will be loaded from the local file system or over the network from looking at the source property, a...

A problem with Relative Path Resolution when setting an Image Source

I have built a small WPF application that allows users to upload documents and then select one to display. The following is the code for the file copy. public static void MoveFile( string directory, string subdirectory) { var open = new OpenFileDialog {Multiselect = false, Filter = "AllFiles|."}; var newLocation = CreateNe...

Ant: How to strip the basedir from an absolute path to get a relative path?

In the build.xml of my project I have a property defined: <property name="somedir.dir" location="my_project/some_dir"/> The value of "${somedir.dir}" will be an absolute path: "/home/myuser/my_project/some_dir". But what I need is just the relative path "./my_project/some_dir" without the ${basedir} value "/home/myuser". How can I ach...

VB.Net: how can I get the source path of the assembly while running MSTest?

I'm trying to switch from NUnit to MSTest (for the Code Coverage option). We have some of the configuration for the application stored in files (the application finds them by using a relative path, starting from the "bin" folder, where the .dlls are). NUnit worked fine with this configuration. MSTest copies the .dlls in a test folder ...

Override ~ behaviour in controls

Quick backstory: I'm making a "framed" version of my site that has a different master page than normal (one suitable for iframing). It's accessed by mysite.com/Framed/whatever, instead of mysite.com/whatever. This is rewritten in IIS to mysite.com/whatever?framed=true. That works fine. The issue I'm having is that all the links are rela...

iphone: relative paths to local file?

Using MontoTouch for .NET C# iPhone development. (though should not matter) In the iPhoneSimulator, I use UIImage.FromFile (@"images/Bahai.png"); to get the Bahai.png from the images folder. However, when I run it in debug mode on my iTouch, the function returns a null. Only if I put the image file in the root does it work in the iTou...

What is the best way to get a path relative to the current address?

Suppose I have a resource located in ~/Resources/R1.png This resource's relative URL will vary depending on the current address. For instance: If I'm at www.foo.com/A/B/C/D.aspx and the www.foo.com/A is the root path including Virtual Directory, then the path relative to the current address of ~/Resources/R1.png is ../../../Resources/R1...

Finding paths for packaged non-java files at runtime

So this might be a stupid question but... I want to package a specific WSDL file in with an EJB project within eclipse. What would be the best way to refer to this file in my code? I would like to use a relative path but the current directory starts off in the /bin directory of my JBOSS installation. It seems like there should be a wa...