<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>fileUpload kontrolu ile birden fazla resim yüklemek | Barış ÖZCAN Web Tasarım | antalya web tasarım | antalya web tasarımı | Sosyal Medya Danışmanlığı</title>
	<atom:link href="https://www.barisozcan.net/etiket/fileupload-kontrolu-ile-birden-fazla-resim-yuklemek/feed" rel="self" type="application/rss+xml" />
	<link>https://www.barisozcan.net</link>
	<description></description>
	<lastBuildDate>Thu, 30 Dec 2010 23:22:05 +0000</lastBuildDate>
	<language>tr</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Asp de fileUpload kontrolu ile birden fazla resim yüklemek</title>
		<link>https://www.barisozcan.net/asp-de-fileupload-kontrolu-ile-birden-fazla-resim-yuklemek</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 30 Dec 2010 23:22:05 +0000</pubDate>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[WEB TASARIM]]></category>
		<category><![CDATA[Asp de birden fazla resim yüklemek]]></category>
		<category><![CDATA[Asp de fileUpload kontrolu]]></category>
		<category><![CDATA[Asp de fileUpload kontrolu ile birden fazla resim yüklemek]]></category>
		<category><![CDATA[asp dersleri]]></category>
		<category><![CDATA[fileUpload kontrolu ile birden fazla resim yüklemek]]></category>
		<category><![CDATA[fileUpload kullanımı]]></category>
		<category><![CDATA[fileUpload nedir]]></category>
		<category><![CDATA[web tasarım dersleri]]></category>
		<guid isPermaLink="false">http://www.barisozcan.net/?p=1206</guid>

					<description><![CDATA[<p>Asp de fileUpload kontrolu ile birden fazla resim yüklemek</p>
<p>The post <a href="https://www.barisozcan.net/asp-de-fileupload-kontrolu-ile-birden-fazla-resim-yuklemek">Asp de fileUpload kontrolu ile birden fazla resim yüklemek</a> first appeared on <a href="https://www.barisozcan.net">Barış ÖZCAN Web Tasarım | antalya web tasarım | antalya web tasarımı | Sosyal Medya Danışmanlığı</a>.</p>]]></description>
										<content:encoded><![CDATA[<iframe src="http://www.facebook.com/plugins/like.php?href=https://www.barisozcan.net/asp-de-fileupload-kontrolu-ile-birden-fazla-resim-yuklemek&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><p>En çok karşılaştığımız durumlardan birisi birden fazla fileupload kullanarak resim yüklemek. Kısaca bunu anlatmaya çalışacağım.</p>
<p>using System;</p>
<pre>using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
<span id="more-1206"></span>
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnResimleriYukle_Click(object sender, EventArgs e)
    {
        //sayfaya 10 tane fileUpload kontrolu ekliyoruz birde button kontrolu ekliyoruz.butona tıklandığı anda (btnResimleriYukle_Click) oalyında resimleri kaydedeceğiz.
        //httpfilekoleksiyon oluşturuyoruz gelen tüm resimleri bu koleksiyon içerisine atıcaz
         HttpFileCollection uploadedFiles = Request.Files;
        //gelenresim adedi kdar for döngüsü içersiinde dönüyorum
         for (int i = 0; i &lt; uploadedFiles.Count; i++)
         {
             //dizi oluşturup her bir fileuploada ulaşıyorum.
             HttpPostedFile userPostedFile = uploadedFiles[i];

             // sıradaki fileuploda resim yüklenmişise kayıt yapılsın
             //10 tane fileupload koyduk diyelim kullanıcı 5 tanesine resim yükledi ozaman boş olanların içinde kaydedecek resim aramayalım boşuna :)
             if (userPostedFile.ContentLength &gt; 0)
             {
                 //burada anahtaruret adlı metoda sırdakı fileuoploadın filename ini veriyorum kı gelen resimadında türkçe karakter yada  geçersiz bir karakter varsa temizlenip string tipinden gelenResimAdi adıdnan yenı bir ada sahip oluyor.
                 string gelenResimAdi = anahtaruret(userPostedFile.FileName);
                 //artık fileuploaddan aldığımız resimin dosyaadı gelenResimAdi oluyor ve bunu da benzersiz bir karakter üretsin(şifreli) diye makeMD5 metoduna sokuyorumve oradan değeri buyukResimAdi adında bir string yapıyorum.sonuna da dosya fiziksel olarak kaydedilirken uzantısının jpg olmasını sağlıyorum
                 string buyukResimAdi = makeMD5(gelenResimAdi) + ".jpg";
                 //artık resim dosyam hazır ve andizizinde images adlı bir kalsor oldugunu varsayıyor ve oraya fiziksel olarak kaydediyorum.
                 userPostedFile.SaveAs(Server.MapPath("~/urunimages/") + buyukResimAdi);
                 //resim bilgilerini database e yazmak istersek Resimler adında bir tablo hazırlayıp(sqlde) Id(int) ve ResimAdi(nvarchar(max)) adında bir kolon oluşturup c# tarafında string tipinden resimadı alan bir metoto yazıp metoda resimadi olarak  buyukResimAdi'nı verebilirz.
             }
         }


    }
    public static string anahtaruret(string key)
    {

        key = key.ToLower();
        key = key.Replace(' ', '_');
        key = key.Replace('ğ', 'g');
        key = key.Replace('ü', 'u');
        key = key.Replace('ş', 's');
        key = key.Replace('ı', 'i');
        key = key.Replace('ö', 'o');
        key = key.Replace('ç', 'c');
        key = key.Replace(",", "");
        key = key.Replace('&amp;', '_');
        key = key.Replace("(", "");
        key = key.Replace(")", "");
        key = key.Replace('*', 'x');
        key = key.Replace("'", "_");
        key = key.Replace("/", "_");

        return key;
    }
    public string makeMD5(string str)
    {
        str = FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5");

        return str;
    }
}

</pre><p>The post <a href="https://www.barisozcan.net/asp-de-fileupload-kontrolu-ile-birden-fazla-resim-yuklemek">Asp de fileUpload kontrolu ile birden fazla resim yüklemek</a> first appeared on <a href="https://www.barisozcan.net">Barış ÖZCAN Web Tasarım | antalya web tasarım | antalya web tasarımı | Sosyal Medya Danışmanlığı</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
