Created
January 26, 2022 19:19
-
-
Save gptshubham595/e56b61e5ee83e95a5f700370be3553bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>File sharing Azure</title> | |
</head> | |
<body> | |
<!-- | |
Resource Group: fileshare | |
storage a/c name: filesharedb | |
container: general | |
--> | |
<!-- UPLOAD SECTION --> | |
<p>Example of HTTPTRIGGER Function URL is https://myapp.azurewebsites.net/api/HttpTrigger1?code=SAMPLEdfsd/ZT24CSAMPLEbuApg==</p> | |
<h1>MSG UPLOAD TO AZURE STORAGE BLOB: (CONTAINER: "general" Function: "HttpTrigger1" Type:"Upload" ResourceGrp: "fileshare")</h1> | |
<form method="post" id="msgform" enctype="multipart/form-data"> | |
<label for="msgtext">Write Text</label> | |
<input type="text" id="msgtext" name="msgtext"><br><br> | |
<input type="submit" onclick="return msgUploadFunction();"> | |
</form> | |
<h1>File UPLOAD TO AZURE STORAGE BLOB: (CONTAINER: "general" Function: "HttpTrigger1" Type:"Upload" ResourceGrp: "fileshare")</h1> | |
<form method="post" action="YOUR_HTTPTRIGGER_URL&type=upload&name=general&uploadtype=other" enctype="multipart/form-data"> | |
<label for="myfile">Select File</label> | |
<input type="file" id="myfile" name="filename"><br><br> | |
<input type="submit"> | |
</form> | |
<!-- NEW GROUP CREATION SECTION --> | |
<h1>CREATE A GROUP IN AZURE STORAGE BLOB: (CONTAINER: "write_new_group_name" Function: "HttpTrigger1" Type:"Create" ResourceGrp: "fileshare")</h1> | |
<form method="post" id="new_group_form" enctype="multipart/form-data"> | |
<label for="new_group_name">Write Name of the Group:</label> | |
<input type="text" id="new_group_name" name="new_group_name"><br><br> | |
<input type="submit" onClick="return newGroupCreateFunction();"> | |
</form> | |
<!-- GROUPA UPLOAD SECTION --> | |
<h1>GROUPA File UPLOAD TO AZURE STORAGE BLOB: (CONTAINER: "groupa" Function: "HttpTrigger1" Type:"Upload" ResourceGrp: "fileshare")</h1> | |
<form method="post" action="YOUR_HTTPTRIGGER_URL&type=upload&name=groupa&uploadtype=other" enctype="multipart/form-data"> | |
<label for="myfile">Select File</label> | |
<input type="file" id="myfile" name="filename"><br><br> | |
<input type="submit"> | |
</form> | |
<!-- ANY GROUP UPLOAD SECTION --> | |
<h1>(ENTER GROUP NAME) File UPLOAD TO AZURE STORAGE BLOB: (CONTAINER: "groupa" Function: "HttpTrigger1" ResourceGrp: "fileshare")</h1> | |
<form method="post" id="your_group_form" enctype="multipart/form-data"> | |
<label for="your_group_name">Write Name of Your Group:</label> | |
<input type="text" id="your_group_name" name="your_group_name"><br><br> | |
<label for="myfile">Select File</label> | |
<input type="file" id="myfile" name="filename"><br><br> | |
<input type="submit" onClick="return yourGroupUploadFunction();"> | |
</form> | |
<!-- LIST ALL GROUPS --> | |
<h1>LIST ALL CONTAINERS/GROUPS INSIDE AZURE STORAGE BLOB: ( Function: "HttpTrigger1" ResourceGrp: "fileshare")</h1> | |
<form method="post" id="list_groups_form" action="YOUR_HTTPTRIGGER_URL&type=listall" enctype="multipart/form-data"> | |
<input type="submit" value="Fetch ALL Groups"> | |
</form> | |
<h1>LIST ALL files in a group INSIDE AZURE STORAGE BLOB: ( Function: "HttpTrigger1" ResourceGrp: "fileshare")</h1> | |
<form method="post" id="list_group_content_form" enctype="multipart/form-data"> | |
<label for="list_group_content">List Contents of Group(Group Name):</label> | |
<input type="text" id="list_group_content" name="list_group_content"><br><br> | |
<input type="submit" value="Fetch ALL Contents of Group" onClick="return listGroupContentFunction();"> | |
</form> | |
<h1>DOWNLOAD A FILE FROM AZURE STORAGE BLOB: (GROUP NAME: "write_name" (default: "general") Function: "HttpTrigger1" Type:"Upload" ResourceGrp: "fileshare")</h1> | |
<form method="post" id="download_group_form" enctype="multipart/form-data"> | |
<label for="download_group_name">Write Name of the Group:</label> | |
<input type="text" id="download_group_name" name="download_group_name"><br><br> | |
<label for="download_item_name">Write item number of the file to download:</label> | |
<input type="text" id="download_item_name" name="download_item_name"><br><br> | |
<input type="submit" onClick="return downloadGroupCreateFunction();"> | |
</form> | |
<h1>DELETE GROUP ON AZURE STORAGE BLOB: (CONTAINER: "write" Function: "HttpTrigger1" Type:"Upload" ResourceGrp: "fileshare")</h1> | |
<form method="post" id="delete_group_form" enctype="multipart/form-data"> | |
<label for="delete_group_name">Write Name of the Group:</label> | |
<input type="text" id="delete_group_name" name="delete_group_name"><br><br> | |
<input type="submit" onClick="return deleteGroupCreateFunction();"> | |
</form> | |
<script> | |
function listGroupContentFunction(){ | |
var action_src = "YOUR_HTTPTRIGGER_URL&type=listallcontent&name="+document.getElementsByName("list_group_content")[0].value; | |
var msgform = document.getElementById('list_group_content_form'); | |
msgform.action = action_src; | |
msgform.submit(); | |
} | |
function msgUploadFunction(){ | |
var action_src = "YOUR_HTTPTRIGGER_URL&type=upload&name=general&uploadtype=text&msg="+document.getElementsByName("msgtext")[0].value; | |
var msgform = document.getElementById('msgform'); | |
msgform.action = action_src; | |
msgform.submit(); | |
} | |
function downloadGroupCreateFunction(){ | |
var action_src = "YOUR_HTTPTRIGGER_URL&type=download&name=" + document.getElementsByName("download_group_name")[0].value+"&itemname="+document.getElementsByName("download_item_name")[0].value; | |
var download_group_form = document.getElementById('download_group_form'); | |
alert(action_src); | |
download_group_form.action = action_src; | |
download_group_form.submit(); | |
} | |
function deleteGroupCreateFunction(){ | |
var action_src = "YOUR_HTTPTRIGGER_URL&type=delete&name=" + document.getElementsByName("delete_group_name")[0].value; | |
var delete_group_form = document.getElementById('delete_group_form'); | |
delete_group_form.action = action_src; | |
delete_group_form.submit(); | |
} | |
function newGroupCreateFunction(){ | |
var new_group_name=document.getElementById("new_group_name").value; | |
var action_src = "YOUR_HTTPTRIGGER_URL&type=create&name=" + document.getElementsByName("new_group_name")[0].value; | |
var new_group_form = document.getElementById('new_group_form'); | |
new_group_form.action = action_src; | |
new_group_form.submit(); | |
} | |
function yourGroupUploadFunction(){ | |
var your_group_name=document.getElementById("your_group_name").value; | |
var action_src = "YOUR_HTTPTRIGGER_URL&type=upload&uploadtype=other&name=" + document.getElementsByName("your_group_name")[0].value; | |
var your_group_form = document.getElementById('your_group_form'); | |
your_group_form.action = action_src; | |
your_group_form.submit(); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment