Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to Find files using http url path?

How to Find files using http url path?

Scheduled Pinned Locked Moved C / C++ / MFC
csharpsysadmindata-structurestutorialquestion
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SIJUTHOMASP
    wrote on last edited by
    #1

    Hi, I have one scenario in code that finds all files from the given local/unc path with wildchar. The code sample is given. The enumerator could iterate through the number of files in that path and return the exact path of each file and which will be added to an array for later use.. The above part is working fine..but my requirement is to find the files in similar way with the url path. For eg; the path will be http://server/test/\*.bmp and it need to get the url of all file existing on that path like, http://server/test/a.bmp, b.bmp, etc.. Is there any way similar to the code given to do this for url path..I have tried the way OpenUrl() and CinternetSession but it didn't work..Would really appreciate for showing the right way.. CFileFind fileFinder; char oldDirectory[512]; GetCurrentDirectory(512,oldDirectory); BOOL flag= fileFinder.FindFile(pathDirectory+strWildcard); while(flag ) { flag = fileFinder.FindNextFile(); lstArray.Add(fileFinder.GetFilePath()); } SetCurrentDirectory(oldDirectory); Thanks in Advance..

    SoftwareDeveloper(.NET)

    S D H S 4 Replies Last reply
    0
    • S SIJUTHOMASP

      Hi, I have one scenario in code that finds all files from the given local/unc path with wildchar. The code sample is given. The enumerator could iterate through the number of files in that path and return the exact path of each file and which will be added to an array for later use.. The above part is working fine..but my requirement is to find the files in similar way with the url path. For eg; the path will be http://server/test/\*.bmp and it need to get the url of all file existing on that path like, http://server/test/a.bmp, b.bmp, etc.. Is there any way similar to the code given to do this for url path..I have tried the way OpenUrl() and CinternetSession but it didn't work..Would really appreciate for showing the right way.. CFileFind fileFinder; char oldDirectory[512]; GetCurrentDirectory(512,oldDirectory); BOOL flag= fileFinder.FindFile(pathDirectory+strWildcard); while(flag ) { flag = fileFinder.FindNextFile(); lstArray.Add(fileFinder.GetFilePath()); } SetCurrentDirectory(oldDirectory); Thanks in Advance..

      SoftwareDeveloper(.NET)

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      HTTP doesn't have (as standard) the concepts required to support file finding. Instead, you probably need the server to return a file list when you GET http://server/test/ (many HTTP servers can give directory listings when you access a directory). Then you can filter that file list to work out which files you want to retrieve from the server.

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      S 1 Reply Last reply
      0
      • S Stuart Dootson

        HTTP doesn't have (as standard) the concepts required to support file finding. Instead, you probably need the server to return a file list when you GET http://server/test/ (many HTTP servers can give directory listings when you access a directory). Then you can filter that file list to work out which files you want to retrieve from the server.

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        S Offline
        S Offline
        SIJUTHOMASP
        wrote on last edited by
        #3

        Stuart, Thanks much for the quick suggestion..I agree that the way server sending the list of files would be better and will proceed in that way.. Appreciating.. Thanks, Rahul..

        SoftwareDeveloper(.NET)

        1 Reply Last reply
        0
        • S SIJUTHOMASP

          Hi, I have one scenario in code that finds all files from the given local/unc path with wildchar. The code sample is given. The enumerator could iterate through the number of files in that path and return the exact path of each file and which will be added to an array for later use.. The above part is working fine..but my requirement is to find the files in similar way with the url path. For eg; the path will be http://server/test/\*.bmp and it need to get the url of all file existing on that path like, http://server/test/a.bmp, b.bmp, etc.. Is there any way similar to the code given to do this for url path..I have tried the way OpenUrl() and CinternetSession but it didn't work..Would really appreciate for showing the right way.. CFileFind fileFinder; char oldDirectory[512]; GetCurrentDirectory(512,oldDirectory); BOOL flag= fileFinder.FindFile(pathDirectory+strWildcard); while(flag ) { flag = fileFinder.FindNextFile(); lstArray.Add(fileFinder.GetFilePath()); } SetCurrentDirectory(oldDirectory); Thanks in Advance..

          SoftwareDeveloper(.NET)

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          There is no MFC class for searching on HTTP servers because HTTP does not support the direct file manipulation required for searches. Can you use CFtpFileFind()?

          "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          1 Reply Last reply
          0
          • S SIJUTHOMASP

            Hi, I have one scenario in code that finds all files from the given local/unc path with wildchar. The code sample is given. The enumerator could iterate through the number of files in that path and return the exact path of each file and which will be added to an array for later use.. The above part is working fine..but my requirement is to find the files in similar way with the url path. For eg; the path will be http://server/test/\*.bmp and it need to get the url of all file existing on that path like, http://server/test/a.bmp, b.bmp, etc.. Is there any way similar to the code given to do this for url path..I have tried the way OpenUrl() and CinternetSession but it didn't work..Would really appreciate for showing the right way.. CFileFind fileFinder; char oldDirectory[512]; GetCurrentDirectory(512,oldDirectory); BOOL flag= fileFinder.FindFile(pathDirectory+strWildcard); while(flag ) { flag = fileFinder.FindNextFile(); lstArray.Add(fileFinder.GetFilePath()); } SetCurrentDirectory(oldDirectory); Thanks in Advance..

            SoftwareDeveloper(.NET)

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            I think its better try to find elements on the we sites(for example Buttons,Images,Labels,...).

            Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

            1 Reply Last reply
            0
            • S SIJUTHOMASP

              Hi, I have one scenario in code that finds all files from the given local/unc path with wildchar. The code sample is given. The enumerator could iterate through the number of files in that path and return the exact path of each file and which will be added to an array for later use.. The above part is working fine..but my requirement is to find the files in similar way with the url path. For eg; the path will be http://server/test/\*.bmp and it need to get the url of all file existing on that path like, http://server/test/a.bmp, b.bmp, etc.. Is there any way similar to the code given to do this for url path..I have tried the way OpenUrl() and CinternetSession but it didn't work..Would really appreciate for showing the right way.. CFileFind fileFinder; char oldDirectory[512]; GetCurrentDirectory(512,oldDirectory); BOOL flag= fileFinder.FindFile(pathDirectory+strWildcard); while(flag ) { flag = fileFinder.FindNextFile(); lstArray.Add(fileFinder.GetFilePath()); } SetCurrentDirectory(oldDirectory); Thanks in Advance..

              SoftwareDeveloper(.NET)

              S Offline
              S Offline
              SIJUTHOMASP
              wrote on last edited by
              #6

              Hi David, Hamid, Thanks much for your responses and suggestions..just made logic like the server finds the list of files from the folder and sending the list to the client with a delimeter then the activex use it.. Thanks, Rahul..

              SoftwareDeveloper(.NET)

              T 1 Reply Last reply
              0
              • S SIJUTHOMASP

                Hi David, Hamid, Thanks much for your responses and suggestions..just made logic like the server finds the list of files from the folder and sending the list to the client with a delimeter then the activex use it.. Thanks, Rahul..

                SoftwareDeveloper(.NET)

                T Offline
                T Offline
                ThatsAlok
                wrote on last edited by
                #7

                there is no direct way to do so, as website doesn't provide this due to security reason. there is other way around, you can create a dummy page on server, which search files for you and retrun you teh list when ever you call that page...? hope i am not missing something here!

                "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
                Never mind - my own stupidity is the source of every "problem" - Mixture

                cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups