Click here to Skip to main content
15,925,661 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Dynamic Report Builder Pin
T M Gray3-Mar-10 10:54
T M Gray3-Mar-10 10:54 
GeneralRe: Dynamic Report Builder Pin
FyreWyrm3-Mar-10 14:16
FyreWyrm3-Mar-10 14:16 
QuestionEdit PDF files in Browser in asp.net Pin
pssuresh3-Mar-10 9:07
pssuresh3-Mar-10 9:07 
AnswerRe: Edit PDF files in Browser in asp.net Pin
Gregory Gadow3-Mar-10 10:28
Gregory Gadow3-Mar-10 10:28 
AnswerRe: Edit PDF files in Browser in asp.net Pin
AndyBot3-Mar-10 19:13
AndyBot3-Mar-10 19:13 
QuestionHow to create table with uneven columns [modified] Solved! Pin
josephu3-Mar-10 6:47
josephu3-Mar-10 6:47 
AnswerRe: How to create table with uneven columns Pin
Ennis Ray Lynch, Jr.3-Mar-10 10:11
Ennis Ray Lynch, Jr.3-Mar-10 10:11 
AnswerRe: How to create table with uneven columns Pin
T M Gray3-Mar-10 10:49
T M Gray3-Mar-10 10:49 
GeneralRe: How to create table with uneven columns [modified] Pin
josephu3-Mar-10 11:29
josephu3-Mar-10 11:29 
AnswerRe: How to create table with uneven columns [modified] Solved! Pin
chengclq3-Mar-10 19:16
chengclq3-Mar-10 19:16 
QuestionMvc Handling POST Requests Pin
Jammer3-Mar-10 6:05
Jammer3-Mar-10 6:05 
AnswerRe: Mvc Handling POST Requests Pin
Not Active3-Mar-10 7:09
mentorNot Active3-Mar-10 7:09 
GeneralRe: Mvc Handling POST Requests Pin
Jammer3-Mar-10 10:57
Jammer3-Mar-10 10:57 
QuestionExcel Import Problem Pin
adkalavadia3-Mar-10 3:55
adkalavadia3-Mar-10 3:55 
AnswerRe: Excel Import Problem Pin
T M Gray3-Mar-10 6:40
T M Gray3-Mar-10 6:40 
GeneralRe: Excel Import Problem Pin
adkalavadia3-Mar-10 17:37
adkalavadia3-Mar-10 17:37 
GeneralRe: Excel Import Problem Pin
T M Gray4-Mar-10 4:58
T M Gray4-Mar-10 4:58 
Questionftp - upload image files Pin
Paulraj G3-Mar-10 1:12
Paulraj G3-Mar-10 1:12 
AnswerRe: ftp - upload image files Pin
The Man from U.N.C.L.E.3-Mar-10 1:36
The Man from U.N.C.L.E.3-Mar-10 1:36 
AnswerRe: ftp - upload image files Pin
April Fans3-Mar-10 17:43
April Fans3-Mar-10 17:43 
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm6.aspx.vb" Inherits="MyData.WebForm6"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm6</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<ASP:panel id="FileUploadForm" visible="true" runat="server">
<FORM id="Form2" method="post" encType="multipart/from-data" runat="server">
<P><INPUT id="loFile" type="file" name="loFile" runat="server"></P>
<P>
<asp:TextBox id="dir" runat="server"></asp:TextBox><BR
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button><BR>
</P>
</FORM>
</ASP:panel>
<ASP:panel id="AnswerMsg" visible="false" runat="server">
<ASP:label id="FileName" runat="server"></ASP:label>
<BR>
<ASP:label id="FileLength" runat="server"></ASP:label>
<BR>
<ASP:label id="FileType" runat="server"></ASP:label>
<BR>
</ASP:panel>
</body>
</HTML>

.vb
Imports System.IO
Imports System.Data

Public Class WebForm6
Inherits System.Web.UI.Page

#Region "



<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub
Protected WithEvents FileUploadForm As System.Web.UI.WebControls.Panel
Protected WithEvents FileName As System.Web.UI.WebControls.Label
Protected WithEvents FileLength As System.Web.UI.WebControls.Label
Protected WithEvents FileType As System.Web.UI.WebControls.Label
Protected WithEvents AnswerMsg As System.Web.UI.WebControls.Panel
Protected WithEvents loFile As System.Web.UI.HtmlControls.HtmlInputFile
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents dir As System.Web.UI.WebControls.TextBox



Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lstrFileName As String
Dim lstrFileNamePath As String
Dim lstrFileFolder As String

If dir.Text <> "" Then
lstrFileFolder = dir.Text
Else
lstrFileFolder = "c:\"
End If

Dim files As System.Web.HttpFileCollection = System.Web.HttpContext.Current.Request.Files
Dim postedFile As System.Web.HttpPostedFile = files(0)

lstrFileName = System.IO.Path.GetFileName(postedFile.FileName)



lstrFileName = Path.GetFileName(lstrFileName)

If (Not Directory.Exists(lstrFileFolder)) Then

Directory.CreateDirectory(lstrFileFolder)
End If

lstrFileNamePath = lstrFileFolder & lstrFileName
loFile.PostedFile.SaveAs(lstrFileNamePath)


FileName.Text = lstrFileName

FileType.Text = loFile.PostedFile.ContentType
FileLength.Text = CStr(loFile.PostedFile.ContentLength)
FileUploadForm.Visible = False
AnswerMsg.Visible = True
End Sub

End Class
April

Comm100 - Leading Live Chat Software Provider

GeneralRe: ftp - upload image files Pin
Paulraj G3-Mar-10 18:10
Paulraj G3-Mar-10 18:10 
QuestionData synchronization Pin
mukesh.mr032-Mar-10 23:00
mukesh.mr032-Mar-10 23:00 
AnswerRe: Data synchronization Pin
R. Giskard Reventlov2-Mar-10 23:41
R. Giskard Reventlov2-Mar-10 23:41 
GeneralRe: Data synchronization Pin
mukesh.mr032-Mar-10 23:49
mukesh.mr032-Mar-10 23:49 
GeneralRe: Data synchronization Pin
R. Giskard Reventlov2-Mar-10 23:58
R. Giskard Reventlov2-Mar-10 23:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.