Results 1 to 3 of 3

Thread: QUrl and ftp scheme parsing

  1. #1
    Join Date
    Nov 2009
    Location
    San Antonio, TX
    Posts
    69
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt Jambi
    Platforms
    Unix/X11 Windows

    Default QUrl and ftp scheme parsing

    I am trying to access a user account using the ftpget example code to download a file from its local dir tree. This uses the CUrl class to parse the URL string. However, it seems to be parsing the url-path incorrectly.

    If I have something like "ftp::/userasswd@192.168.1.1/path/to/follow/FILE", I would expect the path to be "path/to/follow/FILE" but it is "/path/to/follow/FILE". This contradicts what how several other packages process the URL (wget,curl,firefox). Even the Qt Assistant doc shows that the path includes the initial '/' character, which is wrong according the the RFC1738 URL documentation.

    Is there a method to retrieve the proper path? Is there anything in the works to fix this? Or do most people think this is not an issue? If it is known that QUrl will always process the url in this manner then I can at least update the internal url to remove the '/' prefix.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QUrl and ftp scheme parsing

    I always thought the "/" was path of the path to indicate to retrieve the filename based from the webroot rather than being relative to the current position on the web. Is this not the case?

  3. #3
    Join Date
    Nov 2009
    Location
    San Antonio, TX
    Posts
    69
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: QUrl and ftp scheme parsing

    I guess that depends on your definition of web-root. I am no expert, but from what I have read and have used, the path is based on the "root" of the entity processing the scheme/protocol.

    For ftp, it is based on the user login, well suppose to be. For anonymous logins the user is usually restricted to a ftp dir tree and the '/' is based on that. This is usually not the case of a login from a normal user of the system (yes, the ftp server could be configured to restrict the user to its a dir, eg his home directory). He has access to the entire system so a "/" in the path means from the root system not his local login home directory.

    I believe for http access, it is based on the root dir defined by the web process, apache or the like, but again I am not an expert on that.

    Back to ftp and the path, to indicate an absolute path (from the / root dir) you cannot just simply use host//path but must use host/%2Fpath, which CUrl does not seem to process properly. The %2F appears in the path.

Similar Threads

  1. Replies: 1
    Last Post: 13th November 2009, 18:40
  2. qtcreator text editor color scheme problem
    By elflord in forum Qt Tools
    Replies: 1
    Last Post: 5th March 2009, 17:42
  3. QUrl and EUC-JP
    By Ignacio Serantes in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2009, 15:19
  4. QUrl broke?
    By bwindorski in forum Qt Programming
    Replies: 3
    Last Post: 26th January 2009, 20:16
  5. QUrl parsing?
    By gfunk in forum Qt Programming
    Replies: 2
    Last Post: 17th January 2008, 10:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.