Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Commit

Permalink
File listing
Browse files Browse the repository at this point in the history
  • Loading branch information
saqibmasood committed Jan 11, 2018
1 parent aae829a commit 0f73e35
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions GroupDocs.Annotation for .NET/Controllers/FilesController.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
using GroupDocs.Annotation.Domain;
using GroupDocs.Annotation.Domain.Results;
using GroupDocs.Annotation.Handler;
using GroupDocs.Annotation.Handler.Input.DataObjects;
using GroupDocs.Annotation_for.NET.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using System.Collections;
using System.Web.Mvc;

namespace GroupDocs.Annotation_for.NET.Controllers
Expand All @@ -21,7 +12,18 @@ public class FilesController : Controller
public ActionResult Get(string file)
{
Response.AddHeader("Content-Type", "application/json");
return Content("[\"Test - Copy.pdf\"]");
DirectoryInfo d = new DirectoryInfo(this.Server.MapPath("~/App_Data/Storage"));
ArrayList result = new ArrayList();
foreach (FileInfo f in d.GetFiles())
{
if (f.Name == "README.txt" || f.Name.StartsWith("GroupDocs.") || f.Name.StartsWith("."))
{
continue;
}
result.Add(f.Name);
}
return Json(result, JsonRequestBehavior.AllowGet);
}
}
}

0 comments on commit 0f73e35

Please sign in to comment.