1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
private void Button1_Click(object sender, System.EventArgs e)
{
// Envoie le fichier choisi
if ((copy.PostedFile.ContentLength < 1))
{
Label1.Visible = true;
Label1.Text = "Attention : Il manque le fichier ou celui-ci est vide.";
}
else
{
if ((copy.PostedFile.ContentLength > 100000))
{
Label1.Visible = true;
Label1.Text = "Attention : Taille du Fichier trop importante";
}
else
{
Exception exc = new Exception();
string RepertoirePhoto = "\\\\Server-gdp-02\\Filing\\FicheCCC\\";
string Nom_Image = "MonFichierImage.jpg";
try
{
copy.PostedFile.SaveAs(RepertoirePhoto + Nom_Image);
Label1.Visible = true;
Label1.Text = "Upload du fichier : " + Nom_Image + " - Taille : " + copy.PostedFile.ContentLength;
}
catch
{
Label1.Visible = true;
Label1.Text = "Erreur dans l'enregistrement du Fichier : " + Nom_Image;
}
}
}
//eto
} |
Partager