Upload a file using Inet

I'm having trouble uploading a file to an FTP site using the Inet control in VB.  The code that I'm using below allows me to log into the site and download files but doesn't work when I try to upload a file.   Any ideas as to what I'm doing wrong?  Thanks in advance.

   strFile = "test.txt"
   inetUpload.Protocol = icFTP
   inetUpload.URL = "88.25.125.25"
   inetUpload.UserName = "ftpusername"
   inetUpload.Password = "ftppassword"
   inetUpload.Execute inetUpload.URL, "CD testdir\subdirectory"
   inetUpload.Execute inetUpload.URL, "Get " & strFile & " C:\temp\" & strFile
   Do While inetUpload.StillExecuting
      Timeout 1
   Loop

   strFile = "c:\temp\test.txt"
   inetUpload.Execute inetUpload.URL, "SEND " & strFile & " sentfile.txt"
   Do While inetUpload.StillExecuting
      Timeout 1
   Loop
TheChosAsked:
Who is Participating?
 
nffvrxqgrcfqvvcConnect With a Mentor Commented:
basicall you want to set read/write enabled with whatever ftp program you are using to create your ftp address.

angelfire.com is what I use and it works perfect for uploading and downloading,creating folders,deleting folders,renaming folders..etc...
0
 
[ fanpages ]IT Services ConsultantCommented:
Hi,

Presumably you've tried another FTP client to see if you do, in fact, have write priviledges to the area?

Are you specifically looking to use the Inet control, or are you open to alternate methods?

BFN,

fp.
0
 
nffvrxqgrcfqvvcCommented:
Thats because your file has a space in it

inetUpload.Execute inetUpload.URL, "SEND " & strFile & " sentfile.txt"


change to ::

inetUpload.Execute inetUpload.URL, "SEND " & strFile & "sentfile.txt"
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
nffvrxqgrcfqvvcCommented:
instead of using the inet control why dont u have a look at my project is uses all API

go here:::

http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=60125&lngWId=1&txtForceRefresh=421200520391293201
0
 
nffvrxqgrcfqvvcCommented:
0
 
TheChosAuthor Commented:
Yes, I am open to alternate methods for uploading a file.
0
 
nffvrxqgrcfqvvcCommented:
Use FTP API, if you download my project everything is there on how to connect using FTP API. This way you dont need to ship any controls with your project.

0
 
TheChosAuthor Commented:
egl1044,

I'm getting the same results using your code.  I can download files but am unable to send a file.  Do you know of an FTP site that I could use to test my code?  I would like to verify that our security isn't causing the problem.
0
 
nffvrxqgrcfqvvcCommented:
Make sure you set the settings in the UPLOAD button. make sure you username and password are correct and the ftp server.

To test this create a free account at::

www.angelfire.com
0
 
nffvrxqgrcfqvvcCommented:
If you set up your IP address to act as a FTP site then I would make sure you ftp program that creates the ftp site is set to accept uploaded files. You might have the option to write data to ftp server disabled and only have get data enabled.
0
 
TheChosAuthor Commented:
It worked! It appears as though security is the issue.  I still can't upload to the site that I want to but I can upload to other sites.  I'll talk with my administrator to straighten it out.  Thanks for all you help.
0
 
[ fanpages ]IT Services ConsultantCommented:
...I think I said something similar :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.