Simply upload a file through a form input. Wait, then the URL and hash will be displayed in a blue box. To see it in action, simply open the index.html
file in your browser.
Full Code in folder
$(".upload-btn").on("click", function (e) {
// Get form data
var data = new FormData($(".upload")[0]);
// Create URL
var url = BASE_PATH + ACCESS_TOKEN_PARAM
// Request Body
var uploadSettings = {
"url": url,
"data": data,
"cache": false,
"async": true,
"processData": false,
"contentType": false,
"crossDomain": true,
"method":
"POST",
"mimeType": "multipart/form-data"
}
// Upload file
$.ajax(uploadSettings).done(function (response) {
// Get Response
resJson = JSON.parse(response)
// Jquery styling
console.log(resJson)
});