Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Distant file info
Distant file info [message #14073] Fri, 08 February 2008 18:02 Go to next message
Engeor is currently offline  Engeor
Messages: 12
Registered: January 2008
Promising Member
I know how to download file from the web but how can I get info about such distant file? By info I mean things like creation date, size etc.?

[Updated on: Fri, 08 February 2008 18:02]

Report message to a moderator

Re: Distant file info [message #14093 is a reply to message #14073] Sun, 10 February 2008 22:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
This is not quite standardized and there does not seem to be common method that works with every FTP server.

That said, you can use "List" to load directory as String and then parse it....

Mirek
Re: Distant file info [message #14110 is a reply to message #14073] Mon, 11 February 2008 16:15 Go to previous messageGo to next message
Engeor is currently offline  Engeor
Messages: 12
Registered: January 2008
Promising Member
By distant file I mean file that could be retrieved by http. So maybe there is some wrap around HEAD (instead of GET and POST in case of HttpClient)?
Re: Distant file info [message #14111 is a reply to message #14073] Mon, 11 February 2008 16:37 Go to previous messageGo to next message
Engeor is currently offline  Engeor
Messages: 12
Registered: January 2008
Promising Member
OK, I have made small modification to HttpClient:

1) I have add METHOD_HEAD enum.
2) I have modify HttpClient::Exexute() to put HEAD substring into request string.
3) I have terminate same method before body analyzing.

It looks like what I was looking for and I believe it is Smile

As I am not familiar with internet programing I would like just to know whether this approach is OK and if there is not any better method already implemented in UPP.
  • Attachment: httpcli.zip
    (Size: 3.39KB, Downloaded 326 times)
Re: Distant file info [message #14178 is a reply to message #14111] Mon, 18 February 2008 08:32 Go to previous message
rylek is currently offline  rylek
Messages: 79
Registered: November 2005
Member
Hello!

I have applied your modifications to the httpcli.cpp file. The updated uppsrc tree is available on Mirek's UVS repository. I haven't used HEAD myself so far but I believe the code is at least harmless with respect to the existing http client functionality and it sure can be useful in certain situations.

Concerning http client, there are some more directions I would like it to develop. One is that currently it doesn't implement persistent sockets (retrieving multiple requests after a single Connect), there is poor if any support for multiparts and the request execution is monolithic in the sense that you cannot e.g. make a HttpClientStream and incrementally display an image being loaded. Another thing is secure http, i.e. SSL support in the http client. When the time is ready, a potential future revision of the http client should take the above problems into account.

As concerns remote file information retrieval, of course this would be handy in FTP as well. It would be nice to try to tweak the BSD FTP client used (with minor modifications Smile ) in U++ to do this if possible. This way, it would be even possible to extend the FileSelector to (optionally) support more general URL's like remote FTP or HTTP file repositories.

Regards

Tomas
Previous Topic: HTTP Basic Proxy auth
Next Topic: Intentionally inconstistent use of "Atomic" in Mt.h?
Goto Forum:
  


Current Time: Fri Mar 29 11:46:55 CET 2024

Total time taken to generate the page: 0.01957 seconds