URLs with spaces

I know that's a contradiction in terms but here is my problem. My database contains large numbers of 'URLs' with spaces in them reflecting where the corresponding files actually are in the file system. In the longer term I can get them converted to use %20 but in the meantime I have the problem that h:outputLink translates the spaces into +. I'm just wondering if there's something in JSF that will turn them into %20 for me? ... other than fn:replace() which I guess is not a bad alternative ...
Thanks in advance.

SharePoint is a Document Management system which is designed to be user-friendly. Naming all documents in your site farm with no spaces makes the document titles difficult to read for the end users. I agree that, programatically, no spaces is good, but unfortunately,
systems are used by human beings. So even though your suggestion has been marked as an answer, it's not really a solution is it?
The solution I came up with that solved my instance of this problem was to add a text column to the List I was working with, then put some JavaScript in the NewForm.aspx file that copies the file name into the text file and the applies an "encodeURI" to
convert the word spaces into %20 ...
So when I create a new item in my list, the JavaScript takes the file name, converts the spaces to %20, then copies the string into the text field in the list. When I build the WorkFlow Email, instead of concating the file name into a URL, I use the text
field that pulls out (for example) "my%20file" and adds the pre-amble (http://myserver/path/) and the suffix (.pdf) and I have a working URL ...
The full solution is posted at
my blog ...

Similar Messages

  • Reading Contents of URL with Spaces in its Path (+other odd characters)

    Hi, I am looking for a way to get the contents of a webpage that has a pathname with odd characters in it. Here is my "contents reader":
        public static String getURLContents(URL u){
            try {
                Scanner scan = new Scanner((InputStream)u.getContent());
                String output = "";
                while (scan.hasNextLine()) {
                    output += scan.nextLine()+"\n";
                return output;
            } catch (Exception ex) {
                System.out.println(ex);
                return null;
        }I have here selected exception output from two tests on the same URL, which has spaces. First, nicely formatted spaces (" "->%20)
    java.io.FileNotFoundException: http://www.publichealthalert.org/articles/tinagarcia/jemsek%20part%201.htm
    and Secondly, raw spaces:
    java.io.IOException: Server returned HTTP response code: 400 for URL: http://www.publichealthalert.org/articles/tinagarcia/jemsek part 1.htm
    The second example is obvious - there's spaces, and that's not the right way of doing things. But what's going on in the first example??
    Thank you kindly,
    K
    Edited by: nixxlmai on Jun 8, 2009 11:56 AM

    nixxlmai wrote:
    java.io.FileNotFoundException: http://www.publichealthalert.org/articles/tinagarcia/jemsek%20part%201.htm
    But what's going on in the first example??Do you insinuate that it works when there aren't any spaces in the URL? Have you actually tested an URL without any spaces?
    This exception merely means that the URL itsn't reachable on the given domain. It's actually a 404 error.

  • Encode the URL with space

    Hi all
    Ihave some content which needs to be encode with the URL..
    E.G:
    URL is --http://localhost:8080/appname/notify?
    content need to encode---msgtxt=bal P0045IN
    I am using HttpConnector.executeGetMethod(URL_BAL, URLParameters);
    But it giving Error called Sattus 505 error means http version not supported.
    What i find till now is its not allowing "SPACE"
    So please gives some idea
    thanks

    Thanks for reply
    My apllication is like this i have some values which needs to append with the URL and Hit another application which will take care furthere.
    i am using org.apache.commons.httpclient.util.EncodingUtil to encode.
    when i debug it gives right URL but not Hits the that application giving Http version not supported.
    if i copy that URL and paste it In IE ,its working bur from my application not working
    I tried with %20 also, but it giving 404 error
    Please respond

  • How to access a url in file receiver CC with space in the folder name?

    Hi
    PI 7.11 sp4:
    In a file receiver channel I would like to send the message to this folder:
    de-prod.dk\bu\something\something\PTI eventstanden\archive\"
    But I get this error message:
    "Target directory 'F:\usr\sap\XP7\DVEBMGS02\j2ee\cluster\server0\"\de-prod.dk\bu\something\something\PTI eventstanden\archive"' does not exist"
    My question is: where the f.... does it get the 'F:\usr\sap\XP7\DVEBMGS02\j2ee\cluster\server0\  from, and how can I fix it?
    One issue is the space in the folder name. I have tried to replace the space with %20 and then remove the "" s around the whole url, but without any luck.
    When I log on the server on which Pi is running I can access the folder using the mentioned url including the ""s.
    All suggestions would be highly appreciated!
    MIkael

    > But I get this error message:
    >
    > "Target directory 'F:\usr\sap\XP7\DVEBMGS02\j2ee\cluster\server0\"\de-prod.dk\bu\something\something\PTI eventstanden\archive"' does not exist"
    >
    > My question is: where the f.... does it get the 'F:\usr\sap\XP7\DVEBMGS02\j2ee\cluster\server0\  from, and how can I fix it?
    It comes from the "
    Anything else but \ is treated as local folder under working directory of PI
    > One issue is the space in the folder name. I have tried to replace the space with %20 and then remove the "" s around the whole url, but without any luck.
    It works for me just to copy the folder from Windows explorer into channel config. With space and without ".

  • [SOLVED] Download from a SourceForge URL with white spaces

    I was trying to make a PKGBUILD for The Butterfly Effect, a free game which is still in it's Milestone 7 version. The thing is I'm not able to use this URL to download the source:
    "http://download.sourceforge.net/sourceforge/tbe/files/Milestone 7/TheButterflyEffect-M7.src.tgz"
    That is probably because the white space, and it must be SourceForge's fault, since neither wget (the one used with PKGBUILDs) nor Konqueror can download from that location, which I think is correct (I use others that way for other PKGBUILDs).
    So...
    1) Am I wrong, and I should write the URL with another syntax, or
    2) is there a trick for cases like this one?
    Last edited by Gallaecio (2010-06-19 16:35:28)

    I don't know what's the matter with your software, but the correct link to the file is
    http://sunet.dl.sourceforge.net/project/tbe/Milestone%207/TheButterflyEffect-M7.src.tgz
    A space in a weblink usually translates into %20. See this for more info: http://en.wikipedia.org/wiki/Percent-encoding

  • How to escape spaces in a URL with HyperlinkEvent.getDescription()

    Hi,
    I'm trying to open a file whose URL contains spaces, this way:
    if (ev.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
    String urlStr = ev.getDescription();
    BrowserLauncher.openURL(urlStr);
    My urlStr contains the value:
    "file:/C:/Program Files/My Software/Readme.htm"
    and I want to convert it to the correct url format:
    "file:/C:/Program%20Files/My%20Software/Readme.htm".
    I found a usage note for File's toURL() API, that it should be called using toURI() first which automatically escapes characters that are illegal in URLs, anything similar for HyperlinkEvent's getDescription() (or getURL())?
    TIA
    - Vidya.

    Hi,
    I'd tried this earlier, but this also escapes the '/' in the path, resulting into a URL of this form:
    �file%3A%2FC%3A%2FProgram+Files%2FMy+Software%2FReadme.htm�
    This doesn't work, IE is not able to open the link in the above format.
    Thanks,
    Vidya.

  • Unable to access files with spaces in the path

    Hi all, I am accessing files which reside on the server using a java applet.
    The typical path of a file could be:
    http://192.168.0.2/agat/data/AF190701 0003.agt
    (not the space in the filename).
    When I try to open this file using a URL object:
    URL file = new URL(filename);
    BufferedReader in = new BufferedReader(new InputStreamReader(file.openStream()));
    I get exception 400 ( I think) whihc I assume is file cant be found.
    However when I rename the file (to get rid of that space) and also change the filename variable to suit. The file is opened as expected.
    What should I do to make the applet able to open paths with spaces? Or is this just not possible.
    I did try including quotes with the special characte precessor:
    filename = "/"http://192.168.0.2/agat/data/AF190701 0003.agt/""
    But this didnt work either, please could someone tell what I need.
    Thanks.

    Thanks guys, although before I got your replies I did the following - it seems to work, but shall try your suggestions.
    while (file.lastIndexOf(" ") >0)
    String temp;
    int num = file.lastIndexOf(" ");
    temp = file.substring(0, num) + "%20" + file.substring(num+1, file.length());
    file = temp;
    }

  • Link to Network Drive with Spaces

    I need to create a link in SharePoint 2010 that points to a network drive with spaces in the title. SharePoint substitutes %20 for spaces, but I need the space character.
    For example:
    file:///\\company\foldername   works
    file:///\\company\folder name   does not work, it becomes
    file:///\\company\folder%20name 
    Has anyone run into this issue before?

    Hi Andy,
    20% represents space in url encoding and it is hardcoded. I don’t think it is better to remain space character in the link.
    http://en.wikipedia.org/wiki/URL-Encoding
    Here is a thread discuss about that:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/5cc9881d-e72c-434f-be07-bd6d2a74eec6/sharepoint-file-issue-20-replaces-space-in-file-name?forum=sharepointadminlegacy
    http://www.networkworld.com/article/2221731/microsoft-subnet/simple-naming-conventions-that-improve-end-user-experience-in-sharepoint-sites.html
    Regards,
    Rebecca Tu
    TechNet Community Support

  • How to accept arguments with space with a java console?

    hi, i'd like to know if its possible to accept parameters with space in betwen?
    such as on my command prompt..
    java 'i love my keyboard'
    where args[0] = i love my keyboard
    instead of
    args[0] = i
    args[1] = love
    args[2] = my
    args[3] = keyboard
    thanks~

    thanks, i just realised it wasnt the problem with the command line intepreter..
    the space seems to have created some problems when passing it as a URL over to the server.
    such as, for java [name] [phone] ;
    java "Albert Stephen" +60369123
    on the server, it accepts as Albert null
    perhaps i should use the URL Encoder

  • Formatting an NSURL with spaces

    I've got an input string which most certainly will contain spaces or other "bad" characters, which I want to use in a mailto: url such as
    mailto:[email protected]?body=some string with spaces
    I've been searching but I can't seem any sort of method to properly format the string for an NSURL without breaking it.
    Thanks.

    Scan through the "mailto:" URL docs at http://www.ietf.org/rfc/rfc2368.txt
    There are several characters that need to be encode just like the space. It's simply the % character followed by the two digit hex code of the character.

  • READURL Call on Macintosh, won't pass variables with spaces???

    Here is my code and the problem. I am trying to passing a
    tablename and a classname with READURL and the PHP script takes the
    info and returns to me my classid. This works wonderfully on the
    PC, but on the MAC, when I click on a classname with a space I get
    back a empty string as my return value.....here is my code from AW
    and PHP......If you can help I would readlly appreciate it.

    http doesn't like spaces in URLs.
    This clicking on a classname -- is that happening on a web
    page, or in AW?
    Either way, you should urlencode the link. Replace any spaces
    in the URL
    with + signs, either manually on a web page, or by using the
    replace
    function in AW [replace("", "+", string)]. Then, in your PHP
    script, you can
    change the $_classname assignment to include urldecode:
    $_classname = urldecode($_GET["classname"]);
    This should return it to the multi-word format.
    Paul Swanson
    Portland, Oregon, USA
    "bradsteele" <[email protected]> wrote in
    message
    news:[email protected]...
    > Here is my code and the problem. I am trying to passing
    a tablename and a
    > classname with READURL and the PHP script takes the info
    and returns to me
    my
    > classid. This works wonderfully on the PC, but on the
    MAC, when I click
    on a
    > classname with a space I get back a empty string as my
    return
    value.....here is
    > my code from AW and PHP......If you can help I would
    readlly appreciate
    it.
    >
    >
    >
    > getClassID.php code ....
    >
    > <?PHP
    >
    > // MAKE THE SCRIPT NON_CACHEABLE
    > header("Expires: Mon, 26 Jul 1990 05:00:00 GMT");
    > header("Last-Modified: " . gmdate("D, d M Y H:i:s",
    time() + 300) . "
    GMT");
    > header("Cache-Control: no-cache, must-revalidate");
    > header("Pragma: no-cache");
    >
    > // SET VARIABLES
    > $_table = $_GET["table"] . "_classes";
    > $_classname = $_GET["classname"];
    >
    > // LOGIN TO THE DATABASE
    > mysql_connect("localhost", "user", "user") or
    die("Cannot connect to
    DB!");
    > mysql_select_db("trek") or die("Cannot select DB!");
    >
    > // GET CLASS ID
    > $sql = "SELECT classid FROM `$_table` where classname =
    '$_classname'";
    > $r = mysql_query($sql);
    >
    > // IF MORE THAN 1 ROW, THEN PRINT FALSE (ERROR)
    >
    > while ($row = mysql_fetch_assoc($r)) {
    > $query = $row['classid']; }
    > print $query;
    > ?>
    >
    >
    > AUTHORWARE 7.02 CODE BELOW:
    >
    > -- Get the Class ID
    > if NetConnected then
    > www_action := "?action=getData"
    > www_query :="&table=" ^ tablePrefix ^
    "&classname=" ^
    LowerCase(ClassName)
    > www_URLString := NetLocation ^ "getClassID.php" ^
    www_action ^
    www_query
    > www_ClassID := ReadURL(www_URLString, 10)
    > end if
    >

  • Passing parameter with space?

    How does java pass parameter value with spaces? e.g. url?param1=value with space .
    Is there any built in method like PHP's addslashes?
    Thanks.

    URLEncoder.encode("value with
    space","UTF-8")Also the core JSTL tag c:url will encode parameters with spaces, and of course there's the crude way of just using the + sign.

  • Hyperlink with spaces

    We uploaded a file to iFS that had spaces in the title. The corresponding weblink replaced the spaces with '%20'. However, clicking on the hyperlink we made brought up a "not found" message.
    Renaming the file to delete the spaces overcame this problem, but is there a way to have files with spaces accessible from the web?
    Thanks,
    Scott Rappoport

    Hi,
    Even I am facing the same problem. I need to create pre-determined hyperlinks for the files loaded in iFS. If I have to pass any parameter using the url and the parameter value contains a space, its a problem.
    (for ex: http://hostname..../ifs/..test.jsp?topic=new technology )
    In IE, empty spaces are being converted into %20, whereas in Netscape they are converted into "+"(plus) signs. The problem is effective even for ampersands(&).
    I could able to fix the problem for most of the other special characters by passing the search phrase in flower braces{}.(for ex: for ex: ]http://hostname..../ifs/..test.jsp?topic={new-technology} )But for empty space and ampersand, I did not get any solution.
    Please get back to me if any one has a solution for this.
    Thanks..

  • Independent Servers?: Publishing and page names with spaces

    Hello I am hoping someone who has published their site to server independent of .mac could tell me how they managed to name their pages with spaces without publishing problems. I have read here that you have to use an underscore or something similar to name your pages....Eck....I am making a site for my mother's business and I would prefer to use page names like 'about our service' instead of 'aboutourservice'. And I have seen that some people have managed this. Can any kind souls help?
    Thanks!

    DJ.... I publish my site to FOLDER first, then upload
    it to my server using FETCH FTP. It loads fine and
    doesn't have trouble with the menu spaces and such.
    Not sure what everyone else is saying about that, but
    it's not an issue. I use .Mac for my podcasts, and
    iWeb at DreamHost for my internet site.
    Jim -- what's your url? I'm wondering if there are some hosts which automatically replace spaces in uploaded files. Normally you just can't upload them. Or maybe Fetch is doing it for you. Would be useful to know.

  • Passing parameters with spaces in Oracle reports

    I hav a system that passes a query string to a servlet and generates an Oracle Report. All of the varibles worked Ok as long as they don't have spaces in them. Whenever a parameter with spaces is encountered,it generates an error. i tried to enclose it in single or double quotes but it didn't work. I also tried to insert the Url Encode for spaces which is %20 but it also generated an error. pls help me on this one...

    I suppose you're working with GET instead of POST. Try to use the POST method; this gives you the possibility to work with a URL without parameters behind the question mark. This might be the solution to your problem.

Maybe you are looking for

  • Flash websites not working on android 4.1.2 galaxy note.

    One of flash website not working.page shows that install flash player and flash player not installing in my system. Website name http://www.80percentwords.com/ Please help. Thanks alot.

  • The disk you inserted was not readable by this computer problem with External HDD

    Hey Folks! My 500 GB LG External Disk was working until today in the morning than I have went to University and came back this problem appears when I plug my HDD in. It is formatted in MacOS Journalled and when I plug it in it spins up and gets power

  • Screen cracked after 3 days

    hi Ive just upgraded to a z3 after two years of having a z. The screen has cracked in several places when it was in my hand bag not being used. I've booked a repair through Sony but researching online tells me that I will be charged handsomely for th

  • 5200fx Td128

    Well I bought two of these cards, one for each of my computers. I didnt want to spend much on graphics cards, I never have and never will. Actually display wise and fps they do good enough for me. I would be completely happy with them except for the

  • Get disconnected after trying to watch videos or download files

    Whats with jumping through hoops to get technical help? Every time I try to watch a video or download software the browser freezes. It then can't find web pages for about 1-5 minutes and then will re connect to most but will not be able to find any g