spaces in file paths

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Morton

    #16
    Re: spaces in file paths

    DesCF wrote:
    Right, the code for the entire web page is below.
    Ahhhh, web page... URLs... no unencoded spaces allowed.
    If I create a directory J:\Fots and stick some photos in it, it works
    just fine. If I change the directory name to J:\Fot s (i.e. insert a
    space between the t and the s) it just displays the placeholders for
    the right number of photos with little red X's in them.
    If you want a space in a URL, change it to "%20" or "+" for the browser. See
    the UrlEncode function. A better option would be to not use spaces. Look at
    the generated URLs in the resultant web page and see what the browser is
    trying to ask for and also remember to look in the web server's logfile to
    see what was requested and why it could not be returned.

    Does that make sense?

    Andrew


    Comment

    • DesCF

      #17
      Re: spaces in file paths

      I have tried inserting %20 and + and I get back 'Could not find a part of
      the path 'J:\Fot%20s'.' and 'Could not find a part of the path
      'J:\Fot+s'.' respectively. I cannot find the UrlEncode function.

      The URL Address of an empty picture placeholder is:
      file:///J:/Fot%2520s/0001.jpg

      I do not know where to find the web servers log file. I am using Visual
      Web Developer and it creates a kind of pop-up web server on the fly.



      On Mon, 18 Dec 2006 13:53:11 -0000, Andrew Morton
      <akm@in-press.co.uk.inv alidwrote:
      DesCF wrote:
      >Right, the code for the entire web page is below.
      >
      Ahhhh, web page... URLs... no unencoded spaces allowed.
      >
      >If I create a directory J:\Fots and stick some photos in it, it works
      >just fine. If I change the directory name to J:\Fot s (i.e. insert a
      >space between the t and the s) it just displays the placeholders for
      >the right number of photos with little red X's in them.
      >
      If you want a space in a URL, change it to "%20" or "+" for the browser.
      See
      the UrlEncode function. A better option would be to not use spaces. Look
      at
      the generated URLs in the resultant web page and see what the browser is
      trying to ask for and also remember to look in the web server's logfile
      to
      see what was requested and why it could not be returned.
      >
      Does that make sense?
      >
      Andrew
      >
      >


      --
      Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

      Comment

      • Andrew Morton

        #18
        Re: spaces in file paths

        DesCF wrote:
        I have tried inserting %20 and + and I get back 'Could not find a
        part of the path 'J:\Fot%20s'.' and 'Could not find a part of the path
        'J:\Fot+s'.' respectively.
        Which program do those error messages come from?
        I cannot find the UrlEncode function.
        Are you saying that VWD comes without searchable help?
        System.Web.Http ServerUtility.U rlEncode
        >
        The URL Address of an empty picture placeholder is:
        file:///J:/Fot%2520s/0001.jpg
        Is that when looking at the source in a browser? Because %25 is the encoding
        for "%", so it looks like the URL encoding might have been done for you
        already.
        I do not know where to find the web servers log file. I am using
        Visual Web Developer and it creates a kind of pop-up web server on
        the fly.
        I see from the info about VWD that "Visual Web Developer includes the
        ability to create your Web applications using a Web server, FTP site, or
        file share. File share-based Web sites are great for testing and don't
        require you to have IIS installed on your computer, making them a great
        solution on Windows XP Home Edition users." (source:
        http://msdn.microsoft.com/vstudio/ex...y/default.aspx ).

        Apparently you have found a case where file share-based web sites are /not/
        great for testing. Could you install IIS and use that, or are you on XP
        Home?

        Also, you could use FileMon
        (http://www.microsoft.com/technet/sys...s/filemon.mspx) or
        its successor ProcessMonitor
        (http://www.microsoft.com/technet/sys...ssmonitor.mspx)
        to see what file the browser is requesting.

        Or maybe you could just use paths and filenames without spaces?

        Andrew


        Comment

        Working...