Results 1 to 7 of 7

Thread: Url

  1. #1
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    3

    Default Url

    Hello everyone,
    Is it possible to read a URL that represent a folder and to get a list of all the files in it?
    Thanks.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,000
    Blog Entries
    7
    Rep Power
    20

    Default Re: Url

    Quote Originally Posted by tnrh1 View Post
    Hello everyone,
    Is it possible to read a URL that represent a folder and to get a list of all the files in it?
    Thanks.
    What happens when you supply a URL of the form "file://C:/tmp"?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    3

    Default Re: Url

    I can get a single file.
    But if I don't know the file names in the folder and I want to get all of them?

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,000
    Blog Entries
    7
    Rep Power
    20

    Default Re: Url

    Quote Originally Posted by tnrh1 View Post
    I can get a single file.
    But if I don't know the file names in the folder and I want to get all of them?
    I think it's up to the recipient of the url request how to handle the request (otherwise it would be a tremendous security leak). I don't think it can be done without eplicit cooperation from the 'other side'.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: Url

    Quote Originally Posted by tnrh1 View Post
    I can get a single file.
    But if I don't know the file names in the folder and I want to get all of them?
    Have you gone through the methods of the File class?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  6. #6
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    3

    Default Re: Url

    I thought that it has to be done with the URL class.
    The method list() in File is the one I looked for.

    Thanks!

  7. #7
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    3

    Default Re: Url

    I don't want to open another thread since it's related to this subject,
    if I want to specify a folder I would write for example "folder1\anotherfolder\" but how do I specify the current path folder?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •