[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Upload a file using Inet

Posted on 2005-04-21
12
Medium Priority
?
334 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:TheChos
  • 7
  • 3
  • 2
12 Comments
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 13838846
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
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13839501
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
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13839508
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13839520
0
 

Author Comment

by:TheChos
ID: 13843194
Yes, I am open to alternate methods for uploading a file.
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13843239
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
 

Author Comment

by:TheChos
ID: 13843588
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
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13843605
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
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13843639
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
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 2000 total points
ID: 13843662
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
 

Author Comment

by:TheChos
ID: 13843743
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
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 13846736
...I think I said something similar :)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month20 days, 10 hours left to enroll

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question