See list of pdf documents in folder and read


I have an website on Azure. I want a user to be able to store pdf documents online and other people to  be able to see a list of these documents and read them.

What code would I use to see a list of the files in one of the folders? Then if they click on that how would they view the pdf?

Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
PawełConnect With a Mentor SharePoint DeveloperCommented:
you'd use the standard input[type=file] just specify the extension you want to filter

<input type="file" accept=".pdf" />

Open in new window

is that what you're thinking? or do you mean browsing on your azure website for the files?

because in that case you'd have to load the contents of a directory into memory and then display it to the user via some sort of UI. the following is a pretty good tutorial

just check out for the Directory.getFiles(string path, string pattern) function

for the pattern you can submit "*.pdf" to restrict it to pdf files.
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.