![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Falcon |
Hi guys,i have some trouble:
I have some url like this https://someurl/somesome/Eib387h3ox8b2
and i wanna know the name of the file on that url.
Intput url=https://someurl/somesome/Eib387h3ox8b2
Output ‘test.txt’
How can i do that?
Thanks.
I’m not sure what you’re trying to do. What is the url pointing to? A webpage?
MrEliptik | 2021-03-22 22:05
To me, it looks like in the general way you’re posing the question, that’s impossible. unless the Eib387h3ox8b2 at the end of the URL encodes the “test.txt” name, but if it does, I wouldn’t begin to know what decoder to use. It isn’t coded in hex digits and it doesn’t seem to be base64.
URLs may point to files that sit on a webserver, and these files have names on the webserver, but you can’t get the the name of that file - all you have to go on is the URL. If the name isn’t in the URL, in general, you’re stuck. Your web server may send you the name of the file in a HTTP Header, or it might provide an API to get at the filename, but if all you have is some random URL, then no, you can’t get the name of the file that is refered to by that URL.
archeron | 2021-03-23 01:09
Thanks for fast reply!
The url is pointing to some file like “test.txt”
Falcon | 2021-03-23 05:08
Thanks for fast reply!
I have some file on pcloud.com(something like Google drive),I am very new to
HTTPRequest and don’t know how to ask to pcloud to get the name of the file what the url is pointing to.
If it’s impossible then i have an another questions:
I have some serverIp and serverPort (they are variables in my client.gd (192.67.45.140,5075) ) -the address of the server to which the client need to be connected.Lets assume that I changed my server from (192.67.45.140,5075) to (192.45.67.147,5075),how can i tell the clients the new server’s address?
Falcon | 2021-03-23 05:22