VB6 upload and download files from my server

pts.
Tags:
Development
Could anyone give me the VB6 code for uploading and downloading files from my server without using INET?

Answer Wiki

Thanks. We'll let you know when a new response is added.

I use the FileSystemObject whenever I need to copy/move/delete files from code.

‘ First create the object
Set oFSO = CreateObject(“Scripting.FileSystemObject”)

‘ Check the destination folder exists first – if not, create it.
If Not oFSO.FolderExists(strDestination) Then
oFSO.CreateFolder (strDestination)
oFSO.CopyFile strSourcePath & strFileName, strDestination & strFileName
End If

‘ Use the following to check if a file already exists
Set sDelFile = oFSO.GetFile(strDestination & strFileName)

‘ If no error then it exists .Delete (True) deletes without prompting
If Err.Number = 0 Then
sDelFile.Delete (True)
End If

HTH,
Ian

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Sonotsky
    With VB6, IIRC, you're rather limited - it's either use direct inet function calls, set up aliases to the function calls, or buy an VB6 FTP widget. You *may* be able to find a freeware one out there (Google is your friend), only don't expect it to do everything you want - but be happy if it does. Cheers
    695 pointsBadges:
    report
  • Ve3ofa
    Are you referring to the company's server or a web hosting server? Companies server: normal file open/delete routines in vb6 or direct .dll calls As for a webhosting server it depends upon how you access the server... webdav, ftp, etc. if it has frontpage server extensions or webdav access if the server is already in your network objects simple file opening works.. servernamefoldernamefilename
    80 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following