Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit bd37c03

Browse files
Merge pull request #3 from sivakumars3442/master
991215: Replace the sensitive information with explicit placeholders.
2 parents 71ac0cf + 1596571 commit bd37c03

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

FileExplorer/FileExplorerFeatures.aspx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
ID="fileexplorer1" ClientSideOnBeforeDownload ="beforeDownload"
1414
runat="server"
1515
AjaxAction="FileExplorerFeatures.aspx/FileActionDefault"
16-
Path="https://filebrowsercontent.blob.core.windows.net/blob1/Content/">
16+
Path="https://<-----account name------->.blob.core.windows.net/<-----container name------->/Content/">
1717
<AjaxSettings>
1818
<Upload Url="uploadFiles.ashx{0}" />
1919
</AjaxSettings>

FileExplorer/FileExplorerFeatures.aspx.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected void Page_Load(object sender, EventArgs e)
2525
public static object FileActionDefault(string ActionType, string Path, string ExtensionsAllow, string LocationFrom, string LocationTo, string Name, string[] Names, string NewName, string Action, bool CaseSensitive, string SearchString, IEnumerable<CommonFileDetails> CommonFiles, IEnumerable<HttpPostedFileBase> FileUpload)
2626
{
2727
//Please specify the path of azure blob
28-
string startPath = "https://filebrowsercontent.blob.core.windows.net/blob1/";
28+
string startPath = "https://<-----account name------->.blob.core.windows.net/<-----container name------->/";
2929

3030
if (Path != null)
3131
Path = Path.Replace(startPath, "");
@@ -35,7 +35,7 @@ public static object FileActionDefault(string ActionType, string Path, string Ex
3535
LocationTo = LocationTo.Replace(startPath, "");
3636

3737
//Here you have to specify the azure account name, key and blob name
38-
AzureFileOperations operation = new AzureFileOperations("filebrowsercontent", "rbAvmn82fmt7oZ7N/3SXQ9+d9MiQmW2i1FzwAtPfUJL9sb2gZ/+cC6Ei1mkwSbMA1iVSy9hzH1unWfL0fPny0A==", "blob1");
38+
AzureFileOperations operation = new AzureFileOperations("<-----account name------->", "<-----account key------->", "<-----container name------->");
3939
switch (ActionType)
4040
{
4141
case "Read":
@@ -394,4 +394,4 @@ public class AzureFileExplorerParams
394394
public IEnumerable<FileExplorerDirectoryContent> SelectedItems { get; set; }
395395
public IEnumerable<FileExplorerDirectoryContent> TargetFolder { get; set; }
396396
}
397-
}
397+
}

FileExplorer/downloadFile.ashx.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ public class downloadFile : System.Web.UI.Page
2929
public static void Download(string path, string[] names)
3030
{
3131
CloudBlobContainer container;
32-
string accountKey = "rbAvmn82fmt7oZ7N/3SXQ9+d9MiQmW2i1FzwAtPfUJL9sb2gZ/+cC6Ei1mkwSbMA1iVSy9hzH1unWfL0fPny0A==";
33-
string accountName = "filebrowsercontent";
34-
string blobName = "blob1";
32+
string accountKey = "<-----account key------->";
33+
string accountName = "<-----account name------->";
34+
string blobName = "<-----container name------->";
3535
StorageCredentials creds = new StorageCredentials(accountName, accountKey);
3636
CloudStorageAccount account = new CloudStorageAccount(creds, useHttps: true);
3737
CloudBlobClient client = account.CreateCloudBlobClient();
@@ -40,7 +40,7 @@ public static void Download(string path, string[] names)
4040
HttpResponse response = HttpContext.Current.Response;
4141
foreach (var blobFileName in names)
4242
{
43-
string MyPath = path.Replace("https://filebrowsercontent.blob.core.windows.net/blob1/", "");
43+
string MyPath = path.Replace("https://<-----account name------->.blob.core.windows.net/<-----container name------->/", "");
4444
CloudBlockBlob blockBlob = container.GetBlockBlobReference(MyPath + blobFileName);
4545
using (var fileStream = System.IO.File.Create(@"D:\" + blobFileName)) // @"D:\" is the local path to where you wish to download the files
4646
{
@@ -52,4 +52,4 @@ public static void Download(string path, string[] names)
5252
response.End();
5353
}
5454
}
55-
}
55+
}

FileExplorer/uploadFiles.ashx.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public class uploadFiles : IHttpHandler
2828
public async void ProcessRequest(HttpContext context)
2929
{
3030
CloudBlobContainer container;
31-
string accountKey = "rbAvmn82fmt7oZ7N/3SXQ9+d9MiQmW2i1FzwAtPfUJL9sb2gZ/+cC6Ei1mkwSbMA1iVSy9hzH1unWfL0fPny0A==";
32-
string accountName = "filebrowsercontent";
33-
string blobName = "blob1";
31+
string accountKey = "<-----account key------->";
32+
string accountName = "<-----account name------->";
33+
string blobName = "<-----container name------->";
3434
StorageCredentials creds = new StorageCredentials(accountName, accountKey);
3535
CloudStorageAccount account = new CloudStorageAccount(creds, useHttps: true);
3636
CloudBlobClient client = account.CreateCloudBlobClient();
@@ -45,7 +45,7 @@ public async void ProcessRequest(HttpContext context)
4545
for (int i = 0; i < uploadedFiles.Count; i++)
4646
{
4747
string fileName = uploadedFiles[i].FileName;
48-
string MyPath = path.Replace("https://filebrowsercontent.blob.core.windows.net/blob1/", "");
48+
string MyPath = path.Replace("https://<-----account name------->.blob.core.windows.net/<-----container name------->/", "");
4949
CloudBlockBlob blob = container.GetBlockBlobReference(MyPath + fileName);
5050
await container.SetPermissionsAsync(new BlobContainerPermissions
5151
{
@@ -69,4 +69,4 @@ public bool IsReusable
6969
}
7070
}
7171
}
72-
}
72+
}

0 commit comments

Comments
 (0)