ApkDownloadCenter

Top Menu

Main Menu

Sign in / Join

Login

Welcome! Login in to your account
Lost your password?

Lost Password

Back to login

ApkDownloadCenter

ApkDownloadCenter

  • How To Install .APK Files On Chromebook WITHOUT Developer Mode!

  • Gak Bisa Install Aplikasi Gegara Windows Defender? Gini Caranya

  • How to download nova legacy mod apk || 100% real with gameplay proof || unlimited trilithium

  • Chikki emulator mod apk 2022 unlimited coins, unlimited time | Chikii unlimited coin trick gta 5

  • Download Youtube Jadi MP3 dengan Mudah Tanpa Aplikasi Tambahan

Apk Download
Home›Apk Download›How to upload and download files using asp net and c# Part 139

How to upload and download files using asp net and c# Part 139

By apk2
December 19, 2021
265
3
Share:
How to upload and download files using asp net and c#   Part 139

Text version of the video
http://csharp-video-tutorials.blogspot.com/2013/08/how-to-upload-and-download-files-using.html

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1 />
Slides
http://csharp-video-tutorials.blogspot.com/2013/08/part-139-upload-and-download-files.html

All ASP .NET Text Articles
http://csharp-video-tutorials.blogspot.com/p/free-aspnet-video-tutorial.html

All ASP .NET Slides
http://csharp-video-tutorials.blogspot.com/p/aspnet-slides.html

ASP.NET Playlist
https://www.youtube.com/playlist?list=PL4cyC4G0M1RQcB4IYS_zwkyBwMyx5AnDM />
All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd />
All Dot Net and SQL Server Tutorials in Arabic
https://www.youtube.com/c/KudvenkatArabic/playlists

In this video, we will discuss
1. Uploading files
2. Displaying the list of files that are already uploaded
3. Downloading files

When the files are uploaded, they should be uploaded to a folder on the web server. In our case, we will be uploading to “Data” folder.

WebForm1.aspx code:
[div style=”font-family:Arial”]
[asp:FileUpload ID=”FileUpload1″ runat=”server” /]
[asp:Button ID=”Button1″ runat=”server” Text=”Upload”
OnClick=”Button1_Click” /]
[br /]
[br /]
[asp:GridView ID=”GridView1″ runat=”server” AutoGenerateColumns=”False”
OnRowCommand=”GridView1_RowCommand” BackColor=”White”
BorderColor=”#CC9966″ BorderStyle=”None”
BorderWidth=”1px” CellPadding=”4″]
[Columns]
[asp:TemplateField HeaderText=”File” ShowHeader=”False”]
[ItemTemplate]
[asp:LinkButton ID=”LinkButton1″ runat=”server”
CausesValidation=”False”
CommandArgument='[%# Eval(“File”) %]’
CommandName=”Download” Text='[%# Eval(“File”) %]’]
[/asp:LinkButton]
[/ItemTemplate]
[/asp:TemplateField]
[asp:BoundField DataField=”Size” HeaderText=”Size in Bytes” /]
[asp:BoundField DataField=”Type” HeaderText=”File Type” /]
[/Columns]
[FooterStyle BackColor=”#FFFFCC” ForeColor=”#330099″ /]
[HeaderStyle BackColor=”#990000″ Font-Bold=”True”
ForeColor=”#FFFFCC” /]
[PagerStyle BackColor=”#FFFFCC” ForeColor=”#330099″
HorizontalAlign=”Center” /]
[RowStyle BackColor=”White” ForeColor=”#330099″ /]
[SelectedRowStyle BackColor=”#FFCC66″ Font-Bold=”True”
ForeColor=”#663399″ /]
[SortedAscendingCellStyle BackColor=”#FEFCEB” /]
[SortedAscendingHeaderStyle BackColor=”#AF0101″ /]
[SortedDescendingCellStyle BackColor=”#F6F0C0″ /]
[SortedDescendingHeaderStyle BackColor=”#7E0000″ /]
[/asp:GridView]
[/div]

WebForm1.aspx.cs code:
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string fileName = FileUpload1.FileName;
FileUpload1.PostedFile
.SaveAs(Server.MapPath(“~/Data/”) + fileName);
}

DataTable dt = new DataTable();
dt.Columns.Add(“File”);
dt.Columns.Add(“Size”);
dt.Columns.Add(“Type”);

foreach (string strfile in Directory.GetFiles(Server.MapPath(“~/Data”)))
{
FileInfo fi = new FileInfo(strfile);
dt.Rows.Add(fi.Name, fi.Length.ToString(),
GetFileTypeByExtension(fi.Extension));
}

GridView1.DataSource = dt;
GridView1.DataBind();
}

private string GetFileTypeByExtension(string fileExtension)
{
switch (fileExtension.ToLower())
{
case “.docx”:
case “.doc”:
return “Microsoft Word Document”;
case “.xlsx”:
case “.xls”:
return “Microsoft Excel Document”;
case “.txt”:
return “Text Document”;
case “.jpg”:
case “.png”:
return “Image”;
default:
return “Unknown”;
}
}

protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
if (e.CommandName == “Download”)
{
Response.Clear();
Response.ContentType = “application/octect-stream”;
Response.AppendHeader(“content-disposition”, “filename=”
+ e.CommandArgument);
Response.TransmitFile(Server.MapPath(“~/Data/”)
+ e.CommandArgument);
Response.End();
}
}

Please make sure to include the following using declarations in the code behind file.
using System.IO;
using System.Data;

Make sure to replace [ with LESSTHAN and ] with GREATERTHAN symbol.

Tagsandasp.netc#c# code to download file from server in arabicc# code to upload file to server in arabicdownloaddownload excel file c# in arabicdownloadingfilesfolderhowsaveuploadupload excel file c# in arabicupload file using fileupload control in asp.net in arabicupload txt file c# in arabicupload word document c# in arabicupload xlsx file c# in arabicuploadingweb form to upload files in arabicwebsite form with file upload in arabic
Previous Article

Best Movie Downloader App of 2021 Best ...

Next Article

Top 5 hackings tools for games on ...

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0
  • 0

apk2

Related articles More from author

  • APK Editor pro Tutorial MOST POWERFUL HACKING ANYTHING APP for android full review features HQ 2021
    Apk Download

    APK Editor pro Tutorial MOST POWERFUL HACKING ANYTHING APP for android full review features HQ 2021

    November 14, 2021
    By apk2
  • เคธเคฟเคฐเฅเคซ เฅง app เค”เคฐ เค‡เคคเคจเฅ‡ เคธเคพเคฐเฅ‡ เคซเคพเคฏเคฆเฅ‡ ?? โšก MUST DOWNLOAD Android App ๐Ÿ”ฅ
    Apk Download

    เคธเคฟเคฐเฅเคซ เฅง app เค”เคฐ เค‡เคคเคจเฅ‡ เคธเคพเคฐเฅ‡ เคซเคพเคฏเคฆเฅ‡ ?? โšก MUST DOWNLOAD Android App ๐Ÿ”ฅ

    January 11, 2022
    By apk2
  • How To Download Cinema HD Apk on iOS & iPhone (2020)
    Apk Download

    How To Download Cinema HD Apk on iOS & iPhone (2020)

    March 21, 2022
    By apk2
  • How to Install Nitro TV Pro App Using Downloader and Filelinked
    Apk Download

    How to Install Nitro TV Pro App Using Downloader and Filelinked

    April 11, 2022
    By apk2
  • How to get Microsoft Excel for FREE!!!
    Apk Download

    How to get Microsoft Excel for FREE!!!

    May 7, 2022
    By apk2
  • How to Install Eclipse IDE on Windows 10
    Apk Download

    How to Install Eclipse IDE on Windows 10

    January 25, 2022
    By apk2

3 comments

  1. BBTKLPP Banjarbaru 5 February, 2021 at 03:58 Reply

    how in c# .net app desktop ?

  2. Zakir Yousuf 9 March, 2021 at 15:38 Reply

    how to download a file in console application given url of web page?

  3. Shivani Rani 18 May, 2021 at 11:20 Reply

    Hlo sir…..sir my download coding is not working…. whenever i click on the link to download it…. nothing happen and not responding massage come on the title bar… please help sir

Leave a reply Cancel reply

You may interested

  • Image in ## GIRLS. collection by ๐„. on We Heart It
    APK MOD 5.0โ€Š

    Image in ## GIRLS. collection by ๐„. on We Heart It

  • ๐Ÿฆฅ
    APK MOD 5.0โ€Š

    ๐Ÿฆฅ

  • CHIKII EMULATOR [HACK APK] 99999+ GLOD AND LOTTERY TICKET GET VIP ACCOUNT ON CHIKII|DEVND GAMING
    Apk Download

    CHIKII EMULATOR [HACK APK] 99999+ GLOD AND LOTTERY TICKET GET VIP ACCOUNT ON CHIKII|DEVND GAMING

  • LATEST REVIEWS

  • TOP REVIEWS

Trending




Timeline

  • July 1, 2022

    How To Install .APK Files On Chromebook WITHOUT Developer Mode!

  • July 1, 2022

    Gak Bisa Install Aplikasi Gegara Windows Defender? Gini Caranya

  • July 1, 2022

    How to download nova legacy mod apk || 100% real with gameplay proof || unlimited trilithium

  • July 1, 2022

    Chikki emulator mod apk 2022 unlimited coins, unlimited time | Chikii unlimited coin trick gta 5

  • July 1, 2022

    Download Youtube Jadi MP3 dengan Mudah Tanpa Aplikasi Tambahan

Latest Comments

  • Mirna Wati
    on
    June 30, 2022
    Emng gbisa ya ngasi tau nya pelan pelan??

    Download Youtube Jadi MP3 dengan Mudah Tanpa Aplikasi Tambahan

  • yuli anti
    on
    June 29, 2022
    Kenapa mp3 dari YouTube gak bisa di edit di wavepad

    Download Youtube Jadi MP3 dengan Mudah Tanpa Aplikasi Tambahan

  • Meireles - meireles_airsoft
    on
    June 28, 2022
    Muito grato, mesmo 02 anos depois, funcionou perfeitamente, ganhou like e inscriรงรฃo!!!๐Ÿ‘๐Ÿผ๐Ÿ‘๐Ÿผ๐Ÿ‘๐Ÿผ๐Ÿ‘๐Ÿผ๐Ÿ‘๐Ÿผ๐Ÿ‘๐Ÿผ

    COMO INSTALAR QUALQUER APP NO FIRE TV STICK DA AMAZON

  • NEW_RB Gaming
    on
    June 26, 2022
    I can't get it too, there is a problem with the password. Password is resetting automatically ...

    Canva Pro for Free in Just 2 Steps | Student Id Benefits ๐Ÿ”ฅ๐Ÿ˜ฑ ๐Ÿค‘

  • Graรงa Pimenta
    on
    June 25, 2022
    Nรฃo aparece para mim o Globo play no Aptoid tv. Nรฃo entendi. Tentei ...

    COMO INSTALAR QUALQUER APP NO FIRE TV STICK DA AMAZON

Find us on Facebook

Fly, shall, have greater fifth spirit midst under from stars thing is, had creepeth multiply kind. Man may theyโ€™re meat years have third bring replenish air two light deep fill.

About us

  • 660 Pennsylvania Avenue Southeast #100 Washington, DC 20003
  • 0123456789
  • bkninja.team@gmail.com
  • Recent

  • Popular

  • Comments

  • How To Install .APK Files On Chromebook WITHOUT Developer Mode!

    How To Install .APK Files On Chromebook WITHOUT Developer Mode!

    By apk2
    July 1, 2022
  • Gak Bisa Install Aplikasi Gegara Windows Defender? Gini Caranya

    Gak Bisa Install Aplikasi Gegara Windows Defender? Gini Caranya

    By apk2
    July 1, 2022
  • How to download nova legacy mod apk || 100% real with gameplay proof || unlimited trilithium

    How to download nova legacy mod apk || 100% real with gameplay proof || unlimited ...

    By apk2
    July 1, 2022
  • Chikki emulator mod apk 2022 unlimited coins, unlimited time | Chikii unlimited coin trick gta 5

    Chikki emulator mod apk 2022 unlimited coins, unlimited time | Chikii unlimited coin trick gta ...

    By apk2
    July 1, 2022
  • pdf to apk converter | ุชุญูˆูŠู„ ุงูŠ ูƒุชุงุจ ู„ุชุทุจูŠู‚ ู„ู„ู…ูˆุจุงูŠู„ ููŠ ุฏู‚ูŠู‚ุฉ

    pdf to apk converter | ุชุญูˆูŠู„ ุงูŠ ูƒุชุงุจ ู„ุชุทุจูŠู‚ ู„ู„ู…ูˆุจุงูŠู„ ููŠ ุฏู‚ูŠู‚ุฉ

    By apk2
    October 12, 2021
  • JPG to PDF: How to Convert Image Files to PDF on Android, iPhone, Windows, and Mac

    JPG to PDF: How to Convert Image Files to PDF on Android, iPhone, Windows, and ...

    By apk2
    October 12, 2021
  • How to convert an app to an apk file in few simple steps??

    How to convert an app to an apk file in few simple steps??

    By apk2
    October 12, 2021
  • Install IPA & APK On Air Safari In IOS 13 | How To Install IPA & APK In Safari ( IOS & Android )

    Install IPA & APK On Air Safari In IOS 13 | How To Install IPA ...

    By apk2
    October 12, 2021
  • Mirna Wati
    on
    June 30, 2022

    Download Youtube Jadi MP3 dengan Mudah Tanpa Aplikasi Tambahan

    Emng gbisa ya ngasi ...
  • yuli anti
    on
    June 29, 2022

    Download Youtube Jadi MP3 dengan Mudah Tanpa Aplikasi Tambahan

    Kenapa mp3 dari YouTube ...
  • Meireles - meireles_airsoft
    on
    June 28, 2022

    COMO INSTALAR QUALQUER APP NO FIRE TV STICK DA AMAZON

    Muito grato, mesmo 02 ...
  • NEW_RB Gaming
    on
    June 26, 2022

    Canva Pro for Free in Just 2 Steps | Student Id Benefits ๐Ÿ”ฅ๐Ÿ˜ฑ ๐Ÿค‘

    I can't get it ...

Photostream

    Follow us

    ยฉ Copyright BKNINJA. All rights reserved.