0 votes

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?


Godot version 3.2.3
in Engine by (33 points)
recategorized by

I'm not sure what you're trying to do. What is the url pointing to? A webpage?

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.

Thanks for fast reply!
The url is pointing to some file like "test.txt"

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 (,5075) ) -the address of the server to which the client need to be connected.Lets assume that I changed my server from (,5075) to (,5075),how can i tell the clients the new server's address?

2 Answers

0 votes
Best answer

This isn't really a Godot-specific question, it's a question on how to use PCloud.com's API. They seem to have an API that's documented at https://docs.pcloud.com/, so start reading there.

If you need help with how to interface with the API using HTTPRequests, my suggestion would be to download their SDK package for one of the languages you feel comfortable in (they don't seem to have a Python implementation of their SDK, which is a shame, because it would syntactically be closest go GDScript) and look at how their SDK code does the interfacing.

If you need people to help you, you will have much more success asking other PCloud.com users or even PCloud.com's support staff.

Chances are what you want to achieve will be fairly easy, even if you have to write your own interface code in GDScript.

by (295 points)
selected by
0 votes

Sorry for this stupid question,I have solved it by
http post request to 'https://eapi.pcloud.com/getpublinkdownload'

by (33 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.