

Multiple Image Upload Using File Upload In ASP.NET C#
source link: https://www.c-sharpcorner.com/article/multiple-image-upload-using-file-upload-in-asp-net-c-sharp/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Introduction
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="MultiplePhotoupload.aspx.cs" Inherits="MultiplePhotoupload" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
- <!DOCTYPE html>
- <html
- xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <h5 class="text-capitalize px-3">Image Upload</h5>
- <asp:ScriptManager ID="SCPTMGR" runat="server"></asp:ScriptManager>
- <asp:UpdatePanel ID="UpdimageUpload" runat="server">
- <ContentTemplate>
- <asp:FileUpload ID="FileuploadImage" multiple="multiple" runat="server" />
- <asp:Button ID="btnSave" Text="Save Image" runat="server" OnClick="btnSave_Click"/>
- </ContentTemplate>
- <Triggers>
- <asp:PostBackTrigger ControlID="btnSave"/>
- </Triggers>
- </asp:UpdatePanel>
- </div>
- </form>
- </body>
- </html>


- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web;
- using System.IO;
- public partial class MultiplePhotoupload: System.Web.UI.Page {
- protected void Page_Load(object sender, EventArgs e) {}
- protected void btnSave_Click(object sender, EventArgs e) {
- HttpFileCollection _HttpFileCollection = Request.Files;
- for (int i = 0; i < _HttpFileCollection.Count; i++) {
- HttpPostedFile _HttpPostedFile = _HttpFileCollection[i];
- if (_HttpPostedFile.ContentLength > 0) _HttpPostedFile.SaveAs(Server.MapPath("~/image/banner/" + Path.GetFileName(_HttpPostedFile.FileName)));





Summary
Recommend
-
23
Upload Multiple Files with Form Data using jQuery, Ajax, and PHP File upload with form data functionality is very useful f...
-
5
Simple File or Image Upload With Node Server and React JsHome / NodeJs / Simple File or Image Upload With Node Server and React Js
-
15
Upload and Store Image File in Database using PHP and MySQL Server-side file upload can be easily implemented using PHP. There are various ways available to up...
-
9
-
9
In this article, let’s learn about how to perform file upload in ASP.NET Core 6. The file for upload can be of any format like image (jpg, BMP, gif, etc), text file, XML file, CSV file, PDF file, etc. We will learn how to design a web page that al...
-
13
Laravel Livewire Multiple File Upload Example 1887 views 8 months ago Laravel Larave Livewire is a full-stack web framework f...
-
3
Upload File using C# ASP.NET FileUpload Control In this article, we will learn about how to upload a file using File Upload Control in ASP.NET C#. We will create a new project...
-
9
Upload Multiple Images With Preview Using Javascript 7270 views 1 year ago Javascript Image uploading is very co...
-
5
Laravel 5.6 - Multiple File Upload With dropzone.js Many time you need in your laravel application integration multiple file uploading functionality for upload any file or some specific file. you can done this type of ta...
-
8
January 17, 2023 Multiple File Drag and Drop Upload with ASP.NET Core ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK