Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP.net See list of pdf documents in folder and read

Posted on 2016-11-04
2
Medium Priority
?
65 Views
Last Modified: 2016-11-07
Hi

I have an ASP.net 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 VB.net 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?

Thanks
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
Paweł earned 2000 total points
ID: 41873775
you'd use the standard input[type=file] just specify the extension you want to filter

http://www.w3schools.com/tags/att_input_accept.asp

<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

http://www.aspsnippets.com/Articles/Display-list-of-files-from-Server-folder-in-ASPNet-GridView.aspx

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

https://msdn.microsoft.com/en-us/library/wz42302f(v=vs.110).aspx

for the pattern you can submit "*.pdf" to restrict it to pdf files.
0
 

Author Closing Comment

by:Murray Brown
ID: 41878119
Thanks very much
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question