#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0

    Talking Noobie needs the basics looked over (please)


    Hi All.

    Total noob to FTP - have some experience in VBA - and I'm using VBA to upload a file via FTP... I have a suspicion that the FTP .txt and .bat files that my VBA code is producing may not be correct. Could you please look them over and tell me what's in error - if anything is?

    I can tell you that the file is simply not uploading.

    .txt:

    Code:
    open ftp.mysite.com
    ftp@mysite.com
    password
    cd Website-Search/
    binary
    put "C:\Users\Office 2\Dropbox\System\Shells\Australia\System\Website-Search-File\Website-Search.csv"
    bye
    and here's the .bat:

    Code:
    ftp -s:C:\Users\Office 2\Dropbox\System\Shells\Australia\Directory.txt
    Echo "Complete" > C:\Users\Office 2\Dropbox\System\Shells\Australia\Directory.out
    Your help will be very appreciated.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    830
    Rep Power
    275
    check out this LINK.
    scroll down towards bottom of page to see their example scripts.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0

    Red face Thanks... but I still don't get it


    Had a look at that... but the example of what I'm trying to do is:

    Code:
       
       [User_id]
       [ftp_password]   
       binary
       mput *.html
       cd images
       mput *.gif   
       quit
    I've tried working this into my code and I still cannot get the file to upload.

    Perhaps you credit me with too much understanding of this.

    Can you please amend my original codes to something you know will work? Then I can work those back into my code this end.

    Thanks
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    830
    Rep Power
    275
    I don't ever work with the commandline version of ftp.
    But, from the link I gave you, the first thing I noticed was
    in your .bat file your first line should include the host you want to connect to
    and the .txt file should not.
    I believe you need to put double quotes around the path in your .bat file, too[since it has a space in it].
    so, your .bat file should be something like this
    Code:
    ftp -s:"C:\Users\Office 2\Dropbox\System\Shells\Australia\Directory.txt" ftp.mysite.com 
    Echo "Complete" > "C:\Users\Office 2\Dropbox\System\Shells\Australia\Directory.out"
    Also, .csv files are ASCII files, I believe, not binary, so, they should be uploaded as such.
    So, I would assume that your .txt code should be something like this
    Code:
    ftp@mysite.com 
    password 
    cd Website-Search/ 
    ascii 
    put "C:\Users\Office 2\Dropbox\System\Shells\Australia\System\Website-Search-File\Website-Search.csv" 
    bye
    Are you getting any errors when trying to use your script?
    Last edited by DonR; February 18th, 2013 at 02:48 PM.

IMN logo majestic logo threadwatch logo seochat tools logo