:master: prova se va
codice:
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Dim pf As System.Web.HttpPostedFile = Me.FileUpload1.PostedFile
If pf Is Nothing OrElse pf.FileName = "" Then
Throw New Exception("Nome file non specificato")
End If
Dim nome_file As String = Path.GetFileName(pf.FileName)
pf.SaveAs(Path.Combine(Me.Server.MapPath("./"), nome_file))
If pf.ContentType.StartsWith("image") Then
Me.Literal1.Text = String.Format("[img]{0}[/img]", "./" & nome_file.Replace("'"c, "'"))
End If
Catch ex As Exception
Me.Literal1.Text = ex.Message
End Try
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Carica</asp:LinkButton>
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
</div>
</form>
</body>
</html>