How to Find files using http url path?
-
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)
-
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)
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
-
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
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)
-
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)
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
-
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)
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 )
-
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)
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)
-
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)
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" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You