|
-
August 17th, 1999, 03:45 AM
#1
Upload files to FTP Server
How can I upload files to an FTP Server (with VB). Please help me in depth because I am begginer with Internet :-(
Mi
-
August 17th, 1999, 04:26 AM
#2
Found something...
I found a good OCX on this site:
http://ftp.devpower.com/
Let's try it...%
-
August 17th, 1999, 05:32 AM
#3
Re: Found something...
You could download my free class modules that I posted onto the CodeGuru site at http://www.codeguru.com/vb/articles/1852.shtml
These will let you FTP files from VB.
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
-
August 17th, 1999, 05:45 AM
#4
Thanx anyway...
The ocx I found was a better one because it lets you create directories. Thanx anyway...
Michael Vlastos
Company MODUS SA
Development Department
Athens, Greece
Tel: +3-01-9414900
-
August 17th, 1999, 05:51 AM
#5
Re: Thanx anyway...
The WinInet.DLL allows you to create a directory on the server, you'd need to place a new declare in the code -
The C Declaration is :
BOOLAPI
FtpCreateDirectoryA(
IN HINTERNET hConnect,
IN LPCSTR lpszDirectory
);
or for unicode
BOOLAPI
FtpCreateDirectoryW
IN HINTERNET hConnect,
IN LPCWSTR lpszDirectory
);
It should be pretty easy to translate these into the relevant vb declarations and then add the methods into the class - and all for FREE !
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
-
August 17th, 1999, 05:53 AM
#6
Ok thank you!
I'll try both and select the better one. Thanx Chris one more time...
Michael Vlastos
Company MODUS SA
Development Department
Athens, Greece
Tel: +3-01-9414900
-
August 17th, 1999, 06:01 AM
#7
Re: Ok thank you!
In fact, I've already converted that declare and tested it here - works fine.
Place the following 'declare' in the cFTP class :
private Declare Function FtpCreateDirectory Lib "wininet.dll" Alias "FtpCreateDirectoryA" _
(byval hFtpSession as Long, byval lpszDirectory as string) as Boolean
Then place a routine similar to this one in the cFTP class :
public Function CreateDirectory(byval sDirectory as string) as Boolean
on error GoTo vbErrorHandler
Dim bRet as Boolean
If mlConnection = 0 then
on error GoTo 0
Err.Raise errNotConnectedToSite, "CGFTP::GetFile", ERRNOCONNECTION
End If
bRet = FtpCreateDirectory(mlConnection, sDirectory)
If bRet = false then
'
' couldn't create directory - add extra errors to the class
' to handle this
'
End If
CreateDirectory = bRet
Exit Function
vbErrorHandler:
Err.Raise Err.Number, "cFTP::CreateDirectory", Err.Description
End Function
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|