
guardar datos subidos a sql
Publicado por seba (1 intervención) el 09/01/2020 19:19:12
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System;
using System.Collections.Generic;
using System.Linq;using System.Web;using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;namespace ProyectoMuni
{public partial class subida2 : System.Web.UI.Page
{conexionDataContext dc = new conexionDataContext();
protected void Page_Load(object sender, EventArgs e)
{ }protected void BtnSubir_Click(object sender, EventArgs e)
{string extension1 = System.IO.Path.GetExtension(fileupload1.FileName);
string extension2 = System.IO.Path.GetExtension(fileupload2.FileName);
if (fileupload1.HasFile)
{if (extension1 == ".pdf" || extension1 == ".doc")
{fileupload1.SaveAs(Server.MapPath("~/Archivos/ " + fileupload1.FileName));
Label1.Text = "Se subió un archivo";
}else
{Label1.Text = "Seleccione formatos compatibles(PDF)";
} }if (fileupload2.HasFile)
{if (extension2 == ".pdf" || extension2 == ".doc")
{fileupload2.SaveAs(Server.MapPath("~/Archivos/ " + fileupload2.FileName));
Label2.Text = "Se subió un archivo";
}else
{Label2.Text = "Seleccione formatos compatibles(PDF)";
} } } }}tengo ese codigo, se suben los archivos(mueve) a una carpeta que tengo destinada en el pc, quiero que se guarde la ruta, el nombre y demas cosas pero no se como puedo hacerlo :(
Valora esta pregunta


0
