SlideShare a Scribd company logo
WELCOME
TO
ASP.NET Tutorials
on
File upload
• ASP.NET has two controls that allow users to upload files to the web server.
Once the server receives the posted file data, the application can save it,
check it, or ignore it. The following controls allow the file uploading:
• HtmlInputFile - an HTML server control
• FileUpload - and ASP.NET web control
• Both controls allow file uploading, but the FileUpload control automatically
sets the encoding of the form, whereas the HtmlInputFile does not do so.
• In this tutorial, we use the FileUpload control. The FileUpload control allows
the user to browse for and select the file to be uploaded, providing a browse
button and a text box for entering the filename.
• Once, the user has entered the filename in the text box by
typing the name or browsing, the SaveAs method of the
FileUpload control can be called to save the file to the disk.
• The basic syntax of FileUpload is:
• <asp:FileUpload ID= "Uploader" runat = "server" />
• The FileUpload class is derived from the WebControl class,
and inherits all its members. Apart from those, the
FileUpload class has the following read-only properties:
Properties Description
FileBytes Returns an array of the bytes in a file to be uploaded.
FileContent Returns the stream object pointing to the file to be
uploaded.
FileName Returns the name of the file to be uploaded.
HasFile Specifies whether the control has a file to upload.
PostedFile Returns a reference to the uploaded file.
The HttpPostedFile class has the following
frequently used properties:
Properties Description
ContentLength Returns the size of the uploaded file in bytes.
ContentType Returns the MIME type of the uploaded file.
FileName Returns the full filename.
InputStream Returns a stream object pointing to the uploaded file.
Thank You
For more Tutorials on C#, ASP.NET, MVC, JAVASCRIPT, HTML,
CSS subscribe to our YouTube channel
SIRYMEDIA
To watch more videos visit our website
www.sirymedia.in

More Related Content

What's hot

Apache server configuration & optimization
Apache server configuration & optimizationApache server configuration & optimization
Apache server configuration & optimization
Gokul Muralidharan
 
Web Server(Apache),
Web Server(Apache), Web Server(Apache),
Web Server(Apache),
webhostingguy
 
Configuring the Apache Web Server
Configuring the Apache Web ServerConfiguring the Apache Web Server
Configuring the Apache Web Server
webhostingguy
 
APACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXAPACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUX
webhostingguy
 
]project-open[ CVS+ACL Permission Configuration
]project-open[ CVS+ACL Permission Configuration]project-open[ CVS+ACL Permission Configuration
]project-open[ CVS+ACL Permission Configuration
Klaus Hofeditz
 

What's hot (11)

Apache server configuration & optimization
Apache server configuration & optimizationApache server configuration & optimization
Apache server configuration & optimization
 
Apache Server Tutorial
Apache Server TutorialApache Server Tutorial
Apache Server Tutorial
 
Apache web server
Apache web serverApache web server
Apache web server
 
Web Server(Apache),
Web Server(Apache), Web Server(Apache),
Web Server(Apache),
 
Configuring the Apache Web Server
Configuring the Apache Web ServerConfiguring the Apache Web Server
Configuring the Apache Web Server
 
Getting Started
Getting StartedGetting Started
Getting Started
 
Apache web server tutorial for linux
Apache web server tutorial for linuxApache web server tutorial for linux
Apache web server tutorial for linux
 
APACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXAPACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUX
 
Apache ppt
Apache pptApache ppt
Apache ppt
 
Apache Tutorial
Apache TutorialApache Tutorial
Apache Tutorial
 
]project-open[ CVS+ACL Permission Configuration
]project-open[ CVS+ACL Permission Configuration]project-open[ CVS+ACL Permission Configuration
]project-open[ CVS+ACL Permission Configuration
 

Similar to File upload in asp.net

Application Syndication Whitepaper
Application Syndication WhitepaperApplication Syndication Whitepaper
Application Syndication Whitepaper
aboutouria
 
Web Content Management System
Web Content Management SystemWeb Content Management System
Web Content Management System
Elewayte
 
Introducing asp
Introducing aspIntroducing asp
Introducing asp
aspnet123
 

Similar to File upload in asp.net (20)

File upload php
File upload phpFile upload php
File upload php
 
Enterprise Content Management
Enterprise Content ManagementEnterprise Content Management
Enterprise Content Management
 
Is File Load Taking Too Long?
Is File Load Taking Too Long? Is File Load Taking Too Long?
Is File Load Taking Too Long?
 
Information on Apache Handlers
Information on Apache HandlersInformation on Apache Handlers
Information on Apache Handlers
 
Web hosting.pptx
Web hosting.pptxWeb hosting.pptx
Web hosting.pptx
 
Web Development Course: PHP lecture 4
Web Development Course: PHP  lecture 4Web Development Course: PHP  lecture 4
Web Development Course: PHP lecture 4
 
Publishing website by dr. vishnu sharma
Publishing website by dr. vishnu sharmaPublishing website by dr. vishnu sharma
Publishing website by dr. vishnu sharma
 
Application Syndication Whitepaper
Application Syndication WhitepaperApplication Syndication Whitepaper
Application Syndication Whitepaper
 
Ts windchill data_loading
Ts windchill data_loadingTs windchill data_loading
Ts windchill data_loading
 
Introduction to Apache Web Services using latex
 Introduction to Apache Web Services using latex Introduction to Apache Web Services using latex
Introduction to Apache Web Services using latex
 
Wordpress multisite
Wordpress multisiteWordpress multisite
Wordpress multisite
 
Cpanel Guide
Cpanel GuideCpanel Guide
Cpanel Guide
 
R12 d49656 gc10-apps dba 20
R12 d49656 gc10-apps dba 20R12 d49656 gc10-apps dba 20
R12 d49656 gc10-apps dba 20
 
Flyr PHP micro-framework
Flyr PHP micro-frameworkFlyr PHP micro-framework
Flyr PHP micro-framework
 
php
phpphp
php
 
php
phpphp
php
 
Web Content Management System
Web Content Management SystemWeb Content Management System
Web Content Management System
 
COZA HOST HELP
COZA HOST HELPCOZA HOST HELP
COZA HOST HELP
 
How to automate content submission into FileCatalyst Workflow
How to automate content submission into FileCatalyst WorkflowHow to automate content submission into FileCatalyst Workflow
How to automate content submission into FileCatalyst Workflow
 
Introducing asp
Introducing aspIntroducing asp
Introducing asp
 

More from Sireesh K (20)

Cn10
Cn10Cn10
Cn10
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
What is mvc
What is mvcWhat is mvc
What is mvc
 
31c
31c31c
31c
 
31cs
31cs31cs
31cs
 
45c
45c45c
45c
 
44c
44c44c
44c
 
43c
43c43c
43c
 
42c
42c42c
42c
 
41c
41c41c
41c
 
40c
40c40c
40c
 
39c
39c39c
39c
 
38c
38c38c
38c
 
37c
37c37c
37c
 
35c
35c35c
35c
 
34c
34c34c
34c
 
33c
33c33c
33c
 
30c
30c30c
30c
 
29c
29c29c
29c
 

Recently uploaded

Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
Avinash Rai
 

Recently uploaded (20)

Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringBasic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 

File upload in asp.net

  • 3. • ASP.NET has two controls that allow users to upload files to the web server. Once the server receives the posted file data, the application can save it, check it, or ignore it. The following controls allow the file uploading: • HtmlInputFile - an HTML server control • FileUpload - and ASP.NET web control • Both controls allow file uploading, but the FileUpload control automatically sets the encoding of the form, whereas the HtmlInputFile does not do so. • In this tutorial, we use the FileUpload control. The FileUpload control allows the user to browse for and select the file to be uploaded, providing a browse button and a text box for entering the filename.
  • 4. • Once, the user has entered the filename in the text box by typing the name or browsing, the SaveAs method of the FileUpload control can be called to save the file to the disk. • The basic syntax of FileUpload is: • <asp:FileUpload ID= "Uploader" runat = "server" /> • The FileUpload class is derived from the WebControl class, and inherits all its members. Apart from those, the FileUpload class has the following read-only properties:
  • 5. Properties Description FileBytes Returns an array of the bytes in a file to be uploaded. FileContent Returns the stream object pointing to the file to be uploaded. FileName Returns the name of the file to be uploaded. HasFile Specifies whether the control has a file to upload. PostedFile Returns a reference to the uploaded file.
  • 6. The HttpPostedFile class has the following frequently used properties: Properties Description ContentLength Returns the size of the uploaded file in bytes. ContentType Returns the MIME type of the uploaded file. FileName Returns the full filename. InputStream Returns a stream object pointing to the uploaded file.
  • 7. Thank You For more Tutorials on C#, ASP.NET, MVC, JAVASCRIPT, HTML, CSS subscribe to our YouTube channel SIRYMEDIA To watch more videos visit our website www.sirymedia.in