relative-path

Issue with IHttpHandler and relative URLs

Hi, I've developed a IHttpHandler class and I've configured it as verb="*" path="*", so I'm handling all the request with it in an attempt of create my own REST implementation for a test web site that generates the html dynamically. So, when a request for a .css file arrives, I've to do something like context.Response.WriteFile(Server....

Url.Content() equivalent in php?

What is the Url.Content() of asp.net mvc equivalent in php? I have a file that use my style.css from both pathes: 'artciles/123/name' 'artciles/123' How can I use links to static content, witout using absolute urls? ...

image url helper for sinatra?

I'm looking for an image url helper for sinatra that allows me to do something similar to staticmatic's, where I can shortcut to a relative path like so... =img "me.jpg" Can anybody point me in the direction to where this might be online, or where I could learn how to write one, or provide an example of one they have already written ...

CherryPy configuration tools.staticdir.root problem

Hi there, How can I make my static-file root directories relative to my application root folder (instead of a hard-coded path)? In accordance with CP instructions (http://www.cherrypy.org/wiki/StaticContent) I have tried the following in my configuration file: tree.cpapp = cherrypy.Application(cpapp.Root()) tools.staticdir.root = cpap...

Specifying relative paths in SPSS 18

In SPSS 11 it was possible to specify relative paths. Example: FILE HANDLE myfile='..\..\data\current.txt' /LRECL=533. DATA LIST FILE=myfile / ... This worked because apparently, SPSS 11 set the working folder to the path where the source .SPS file is saved. It seems that SPSS 18 always sets it's working folder to the installation fol...

Manipulating Directory Paths in Python

Basically I've got this current url and this other key that I want to merge into a new url, but there are three different cases. Suppose the current url is localhost:32401/A/B/foo if key is bar then I want to return localhost:32401/A/B/bar if key starts with a slash and is /A/bar then I want to return localhost:32401/A/bar finally if...

Is there a simple way to specify a WPF databinding where the path is one "level" up?

This example is a admittedly a little contrived but I am doing something similar. Let's say I have the following simple classes: public class Person { public string Name { get; set; } public List<Alias> Aliases { get; set; } } public class Alias { public string AliasName { get; set; } } And let's say that I have Xaml with...

Can I use an HTML base tag to resolve a virtual directory?

I have an ASP.NET MVC web application running in IIS as a subweb; let's say its path is something like http://mysite.com/subweb. I have a view which serves content obtained from a CMS. The CMS editor has entered some content containing a relative image path <img src="/images/imga.png" />. This works fine on the production server where...

Get relative path in Javascript

I've got this app where I'm using an IHttpHandler to serve JSON data to my JavaScript method. var theUrl = location.href; var txtCity = '#<%= txtForSaleCity.ClientID %>'; var hidCity = '#<%= hiddenForSaleCityID.ClientID %>'; var theSource = '<%= Page.ResolveUrl("~/RegionsAutoComplete.axd")%>?PID=<%= hiddenBusinessProvince.value ...

iPhone pathForResource vs bundlePath

I want to use pathForResource, but it doesn't look like it will create the path if one doesn't exist. Therefore I'm trying to create one manually by doing the following: NSString *path = [NSString stringWithFormat:@"%@/%@.plist",[[NSBundle mainBundle] bundlePath],@"myFileName"]; I'm creating files dynamically, so I need to access th...

Asp.Net single control render for AJAX calls

I'm trying to implement something similar to this or this. I've created a user control, a web service and a web method to return the rendered html of the control, executing the ajax calls via jQuery. All works fine, but if I put something in the user control that uses a relative path (in my case an HyperLink with NavigateUrl="~/mypage....

Pydev relative path

Hello, I installed eclipse with pydev plugin. I need to run my existing project on eclipse. But there are relative paths to the files inside my code. I expect from eclipse to append relative paths to the project's default directory. Instead, it appends the relative path to the directory where Eclipse is installed. I could not find a way...

How to get a path from a directory in a C# console application?

Hi Say I have this file structure Soultion-> Folder1 -> FileIwant.html So this could be something like C:\Soultion\Folder1\FilterIwant.html Now I need to read this file into my application. I can't just hardcode it since when I give it to someone else they might put it on F: drive or something. Or when I create a msi file the path m...

Working with relative URIs

I'm having a little trouble with relative URIs I have a simple HttpListener app that is listening in on a given prefix (currently it is http://+:80/Temporary_Listen_Addresses/, but it could be any other valid prefix). For a any given request, I'm trying to work out what the requested URI is relative to that prefix, so for example if so...

Relative path to a web application project in asp.net 4.0 ?

Hi all I have a project that i reference the services for my graphs...and i have hardcoded urls something like - ViewData["weeklyGraphURL"] = "\"http://localhost:9713/MyProject/MyAction"+Id + "\""; So this url is basically another projects controller action...and i have both these projects in one solution...is there a way i could set ...

Include path and weird structure

Hai. I've got site which is really weird, and now is making me troubles. This is simplified structure public_html - adm --- raport ------ raportpdf.php --- class ------ Bonus --------- Bonus_DAO.class.php ------ config.php --- raport.php - index.php So. Index.php is giant loader. It has lines: (but I don't think that they are making ...

ASP.net relative paths not working?

This should be pretty simple but it's not working. I have a file underneath the root of my project. I want to call it like this. GetWorkbook("tplBud806_wRevenue.xls") I publish the project out to the server and try to run it and the server says it can't find it. Could not find file 'c:\windows\system32\inetsrv\tplBud806_wRevenue.xls...

asp.net: refer to a page relative to root in normal non-server-side html controls

I've a page that is deeply nested. And one that is in the root path. Inside of the deeply nested page I have an anchor tag which is supposed to navigate to another page (which is not in the root, but it is easy to specify a root relative path). I've done the following trying to specify a root relative path: <a href="~/home/main.aspx">H...

Access parent drive "relatively" on Windows

Is there any "built-in" way to access the parent drive "relatively" on Windows? i.e, instead of my program storing a path like K:\1\2\3 (K:\ being a USB flash drive), I'd like it to store the path without the drive letter, that way if the drive letter happens to change in the future, the stored path will still be valid because it's dyna...

PHP Include calling other files.

I realized I used a particular function over and over again in my PHP files, so I took the function out of all of them and put it in a seperate PHP file and included it where I need it. Now when I make updates to the function, all the files that use it get updated. Great. Now there is just one problem, the function itself uses relative...