yea i tryed that
but i am getting an error
vb Code:
Option Strict Off
Imports System.Net
Module Module1
Sub Main()
Dim intChunk As Integer
Dim intoffset As Integer
Dim clsRequest As System.Net.FtpWebRequest = _
DirectCast(System.Net.WebRequest.Create("ftp://dlh-digital.com/public_html/images/ftptest"), System.Net.FtpWebRequest)
clsRequest.Credentials = New System.Net.NetworkCredential("username", "password")
clsRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile
' read in file...
Dim bFile() As Byte = System.IO.File.ReadAllBytes(Form5.TextBox2.Text)
' upload file...
Dim clsStream As System.IO.Stream = clsRequest.GetRequestStream()
intChunk = bFile.Length / 100
Form5.pbUpload.Maximum = 100
For I As Integer = 1 To 100
If intOffset + intChunk > bFile.Length Then intChunk = bFile.Length - intOffset
clsStream.Write(bFile, intOffset, intChunk)
intOffset += intChunk
Form5.pbUpload.Value = I
Next
clsStream.Close()
clsStream.Dispose()
End Sub
End Module
but on this line it errors on me
Dim clsStream As System.IO.Stream = clsRequest.GetRequestStream()
with the error code
The remote server returned an error: (553) File name not allowed.
ware am i going wrong....