14.3. Displaying Uploaded Image Files As Thumbnails
Sharing files is one of the most popular pastimes on the Internet. Participants in a Web site upload pictures and videos for others to view. In this section, you create a small ASP.NET application that uploads a large image to the Web server and then immediately displays a thumbnail version of the image. In the following sections, you see that ASP.NET and the .NET Framework do most of the work. Your job is to assemble and organize the work crew.
14.3.1. Accepting a file upload
The goal in this section is to let a visitor upload an image file and store the image on the Web server. The code is picky about what it accepts: The file must have a .gif or .jpg extension. Anything else generates a warning.
|
To create a page that uploads images, follow these steps:
Make sure that your project has an images folder.
Add an ASP.NET page named upld.aspx to your project (File
New File
Web Form) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access