Solved

example to upload .pdf files in asp.net

Posted on 2014-02-12
2
544 Views
Last Modified: 2014-03-05
Hi all, i need a structure to upload .pdf files
and add a description and a viewer in order to download it, or add it a file
is any example can you provide me asp.net 2010

tsm
edo
0
Comment
Question by:edo60
2 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39854391
here's a good tutorial for you to read on the basics of uploading files:

http://www.developer.com/net/asp/article.php/3097661/File-Uploading-Using-ASPNET.htm

to summarize, you create a form where the end user can select a file to upload. once they hit submit, you then save the file somewhere on your web server (maybe a folder called "/uploads/") and then save the path of the file to the database, which you can then retrieve later to display the info.

Read the tutorial, try out some code, then come back and asp specific questions on where you get stuck.
0
 

Author Comment

by:edo60
ID: 39857239
hi you expert
In the document you send me is not clear in where i need to put this code

Public Function FileFieldSelected(ByVal FileField As _
  System.Web.UI.HtmlControls.HtmlInputFile) As Boolean
    ' Returns a True if the passed
    ' FileField has had a user post a file
    If FileField.PostedFile Is Nothing Then Return False
    If FileField.PostedFile.ContentLength = 0 Then Return False
    Return True
End Function

and what code is in the upload file button?
tsm
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

770 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