Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Upload Files to an FTP Site
Message
From
24/01/2007 00:53:33
 
 
To
24/01/2007 00:34:34
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
Miscellaneous
Thread ID:
01188500
Message ID:
01188503
Views:
17
This message has been marked as the solution to the initial question of the thread.
>Hi all!
>
>I need help with an ASP page I've been working on. I created a page that collects information from a user and allow that user to attach a supporting excel file using the FileUpload control. My problem is:
>
>1. What command do I use to upload the file to a secured FTP site?
>2. How do I create a folder on that site to before uploading?
>3. And how do I check if that folder already existed?
>
>Sorry about this... but this problem has been bugging me since last week 8-(

To upload, you may take a look at System.Web.UI.WebControls.FileUpload.

To create a directory, some of that can be used:
        ' Create a directory
        ' expC1 Directory
        Public Function CreateDirectory(ByVal tcDirectory As String) As Boolean
            Dim llSuccess As Boolean
            llSuccess = False
            Try
                Directory.CreateDirectory(tcDirectory)
                llSuccess = True
            Catch loError As Exception

                ' Get the proper definition as per the current scope
                If oProcess Is Nothing Then
                    oApp.ErrorSetup(loError)
                Else
                    oProcess.ErrorSetup(loError)
                End If

            End Try
            Return llSuccess
        End Function
The following let you know if a directory exist:
        ' Check if a directory exist
        Public Function DirectoryExist(ByVal tcDirectory As String) As Boolean
            Dim llExist As Boolean = False
            If Directory.Exists(tcDirectory) Then
                llExist = True
            Else
                llExist = False
            End If
            Return llExist
        End Function
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform