Solved

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

Posted on 2016-11-04
2
31 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 9

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

774 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