Solved

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

Posted on 2016-11-04
2
28 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:murbro
2 Comments
 
LVL 8

Accepted Solution

by:
Paweł earned 500 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:murbro
ID: 41878119
Thanks very much
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now