Jason Phang
Well-known member
- Joined
- Aug 13, 2019
- Messages
- 46
- Programming Experience
- Beginner
The code block below is supposed to sort of compare the hash value of the files and if there is an existing hash, then a message should be notified to the user that it is a duplicate. For now, i am able to see it from the throw catch exception. I just wanted like an error message to be displayed.
This is the code for my upload button.
For that case, since this program is an ASP.NET. is there a way for me to like display a pop-up message once the exception is displayed? Do i run it from razor or i can do it from asp.net?
public static void compareHash(string path)
{
DriveService service = GetService();
FilesResource.ListRequest FileListRequest = service.Files.List();
IList<Google.Apis.Drive.v3.Data.File> files = FileListRequest.Execute().Files;
List<GoogleDriveFiles> FileList = new List<GoogleDriveFiles>();
foreach (var file in files)
{
if (file.Md5Checksum.Equals(path))
{
throw new Exception("File already exists");
}} }
This is the code for my upload button.
<label for="file">Upload file:</label>
<input type="file" name="file" id="file" />
<input type="submit" value="Upload" id="fileUpload" />
For that case, since this program is an ASP.NET. is there a way for me to like display a pop-up message once the exception is displayed? Do i run it from razor or i can do it from asp.net?