Base64: How can i convert a URL to base64 format? [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
i do have question, i have a PDF file fetched in my server which returns a resource location URL, I want to convert it to base64 how do i do that? thank you

I hope this can help you
btoa('www.aws.com/pdf.file') //"d3d3LmF3cy5jb20vcGRmLmZpbGU="

Related

About the implementation of the MTProtocol [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 days ago.
Improve this question
source code: https://github.com/morethanwords/tweb
About the implementation of the MTProtocol
I checked the source code, but did not find the socket connection code. Is it implemented in wasm? I need help. Thanks.
i hope to get an answer

How to split up a js file? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a problem where I can't upload a js file to GitHub because it is too large. Is there a way to split it into multiple smaller files that still work in the same way?
Instead of splitting the file, use Git LFS
https://git-lfs.github.com/

Get parameters from URL with JS or jQuery [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I've this type of URL:
https://example.com/page#param1|param2
How can I get param1 and param2 ?
Thanks.
Those are part of the hash if you are getting them from the current url.
_hash = window.location.hash.split("|")
console.log(_hash)

take information from github readme.md [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
https://github.com/octocat/Hello-World
There is a repository, I need to take content from readme.md file.
I've found
https://api.github.com/repos/octocat/Hello-World/readme
but the content is in base64 encoding.
How can i get normal text?
You can convert base64 to content using atob
axios
.get("https://api.github.com/repos/octocat/Hello-World/readme")
.then(({ data: {content} }) => {
console.log(atob(content));
});
console.log(atob("SGVsbG8gV29ybGQhCg==\n"))
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.2/axios.min.js"></script>

Extracting specific string in a url using java code/javascript [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have the below url and I need to get back the value after api/ which is nam.
http://apidtgateway.mycompany.co.za:9800/agencychannel-uiapiservices/api/nam/CrmUserManagement/SaveActivity
Any help would be highly appriciated thanks in advance.
Here is how you will do it.
var URL = "http://apidtgateway.mycompany.co.za:9800/agencychannel-uiapiservices/api/nam/CrmUserManagement/SaveActivity";
if (URL.indexOf("api/") >= 0) {
var part = URL.split("api/")[1].split("/")[0];
console.log(part);
}

Categories

Resources