uri

Converting relative paths to absolute paths C#

Hi, I have a program that trawls html files and finds href tags, takes the string inside (the link), and converts it to the file location. The problem comes when the href tag uses relative links, eg: <a href="../../../images/arrow.gif"/> In that case, my program returns: \\server\webroot\folder\foo\bar\mew\..\..\..\images\arrow.gif ...

Is the Scheme Optional in URIs?

I was recently asked to add some Woopra JavaScript to a website and noticed that the URL started with a double slash (i.e. omitted the scheme). I've never seen this before, so I went trying to find out more about it, but the only thing I could really find was an item on the Woopra FAQ: The Woopra JavaScript in the Setup does not inc...

Encoding rules for URL with the `javascript:` pseudo-protocol?

Is there any authoritative reference about the syntax and encoding of an URL for the pseudo-protocol javascript:? (I know it's not very well considered, but anyway it's useful for bookmarklets). First, we know that standard URLs follow the syntax: scheme://username:password@domain:port/path?query_string#anchor but this format doesn...

What is the most efficient way to format UTF-8 strings in java?

I am doing the following: String url = String.format(WEBSERVICE_WITH_CITYSTATE, cityName, stateName); String urlUtf8 = new String(url.getBytes(), "UTF8"); Log.d(TAG, "URL: [" + urlUtf8 + "]"); Reader reader = WebService.queryApi(url); The output that I am looking for is essentially to get the city name with blanks (e.g., "Overland Par...

How to structure URI query for multiple values for same key?

I'm trying to structure a URI that accesses my data by id. Currently my URIs are query based like so: .../content?parentList=15&type=note How could I structure a similar URI so that I could query for notes in multiple lists? Essentially combining the results of the next two URIs. .../content?parentList=15&type=note .../content?pare...

Rails: base64 and character escaping problem

In my app I need to encode a string via base64, escape it's possible special characters and put it into a URL. I do the following: string = "[email protected]" enc = OpenSSL::Cipher::Cipher.new('DES-EDE3-CBC') enc.encrypt('dummy_salt') encoded = URI.escape(Base64.encode64(enc.update(string) << enc.final)) The problem is, that ...

What is the correct URI for sending parameters via POST in WCF REST Services?

Hi all, Let's say that I have specified the following WCF REST Service at the address "http://localhost/MyRESTService/MyRESTService.svc" [ServiceContract] public interface IMyRESTService { [OperationContract] [WebInvoke( Method = "POST", UriTemplate = "/receive")] string Receive(string text); Now I can call my REST service in Fid...

PHP: Codeigniter style-url:s?

Hi everybody, I am looking for some help on how to create the sort of URL-rewriting CodeIgniter features for my own PHP pet application. I know that the .htaccess-file does one part of the magic, but how does a PHP file looks that handles the URL splitting and calling of controllers/methods accordingly to the URI? Thanks a lot for yo...

android get filename and path from uri from mediastore

I have an onActivityResult returning from an mediastore image selection which I can get a URI for an image using the following: Uri selectedImage = data.getData(); Converting this to a string gives this: content://media/external/images/media/47 Or to a path gives: /external/images/media/47 However I can't seem to find a wa...

Why does DistributedCache mangle my file names.

Hi I have a weird problem, DistributedCache appears to change the names of my files, it uses the original name as the parent folder and adds the file as a child. i.e. folder\filename.ext becomes folder\filename.ext\filename.ext Any ideas, my code is below. Thanks Akintayo String paramsLocation="/user/fwang/settings/ecgparams.txt"; D...

PayPal API Listener Website Payments Standard URI

The PayPal IPN Guide documentation says clearly Post the request to www.paypal.com or www.sandbox.paypal.com, depending on whether you are going live or testing your listener in the Sandbox. Wait for a response from PayPal, which is either VERIFIED or INVALID. Well, I tried that (the Sandbox version), and the response was a full HTML...

Is it really important to use pack URIs in WPF apps?

Why should we use those, rather than ordinary ones? what's the benefits of using this: new Uri("pack://application:,,,/File.xaml"); over that: new Uri("/File.xaml", UriKind.Relative); ...

Testing for the existence of a resource given its relative URI

I wrote a little Java servlet that would dynamically generate an image button given parameters including label, height, width and so on, and it would add each new one to a cache. It worked fine, BUT it required a servlet call for every call to display the button or its highlighted version. I dumped the cache and made PNG files of all the...

CodeIgniter passing a URI as a parameter

I have a script that takes input that looks like this... http://tracking.mysite.com/9/1091/2115/u/http%3A%2F%2Fwww.foobar.com%2Ftestdir%2F But when I do this... die(print_r($this->uri->uri_to_assoc(4),TRUE)); I get this... (probably because CodeIgniter or Apache is decoding the URI embedded within the URI) Array ( [1091] => 2115 [u...

[Android]set URI handler

I am working on an application wich has its own URI prefix. (dchub:// in this case) Searching all over and read a lot but i got a bit confused, is there a way when someone open his browser, clicks on a link starting with dchub:// my app starts using this address? so far found a lot of examples the otherway around opening the browser fr...

Resolving URI character encoding issues in Rails

I'm working with a Ruby on Rails application that makes a client side API call to a 3rd party service. It then takes strings from the 3rd party API and generates URIs with them. Unfortunately, Rails fails to parse some of the URIs due to encoding errors. I have tried running the strings through encodeURIComponent, but this does not reso...

System.NotSupportedException. The URI prefix is not recognized.

I have a WCF service, in two machine in Preproduction environment, machine A and machine B. Only in machine B, the service fails when I call it (from biztalk proccess), another machine is right. The configuration of service in both machines is the same. I get this error: System.NotSupportedException, mscorlib, Version=2.0.0.0, ...

Java - Convert String to Uri

How can I convert a String to a Uri in Java (Android)? i.e.: String myUrl = "http://stackoverflow.com"; myUri = ???; ...

C# I want the url, not the physical pathname

For this line of code; string link = HttpContext.Current.Server.MapPath("/Contract/Details/" + this.ContractId.ToString()); I get the physical pathname on C drive. What I want is the url, ie http://localhost:1234/Contract/Details/1 How do I get this? ...

Ruby URI Manipulation

Hello, Is there any way to manipulate a URI in Ruby to accept parameters without the use of ? and &? For example, I wish to do the following: http://localhost:5000/service/get/ip/port instead of http://localhost:5000/service?ip=192.168.1.1&amp;port=1 To return information for a given device. This would utilizes a fully REST-based i...