I've been using the following code for all sorts of files, and it works great, but when i try to upload a pic the image gets distorted and only a small portion of it uploads. I was looking for a better idea if possible
i tried changing fs.CreateTextFile to fs.CreateImageFile but that generated an error
tx
Code:
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\script.dat", True)
a.WriteLine Range("a1").Text 'username
a.WriteLine Range("a2").Text 'password
a.WriteLine Range("a3").Text '(or "cd directory1/directory2" as needed)
a.WriteLine Range("a3").Text 'file to be uploaded
a.WriteLine "quit"
a.Close
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\upload.bat", True)
a.WriteLine Range("a4").Text 'the ftp site
a.Close
dRetVal = Shell("C:\upload.bat", 0) 'upload the file
i tried changing fs.CreateTextFile to fs.CreateImageFile but that generated an error
tx