Results 1 to 11 of 11

Thread: Can't access dir's with spaces in them

  1. #1
    Guest

    Post

    I need to access a directory with a space in it.

    exmple: ftp.execute "ftp://1.1.1.1", "get /azzmodan file/file1.zip c:\temp\file1.zip"

    The problem is that it won't accept /azzmodan file/file1.zip it thinks it should get /azzmodan and save it as file/file1.zip so it completely bugs on me.

    How would i access the dir?
    The dir is on an NT Server running IIS5
    It won't accept azzmodan+file or azzmodan%20file.

    Thx.

    ------------------

    Vincent van den Braken
    EMail: [email protected]
    ICQ: 15440110
    Homepage: http://www.azzmodan.demon.nl




  2. #2
    Guest

    Post

    Nope ;(

    Ill try it with the getfile api maybe that that will work.

    Thx for the reply though.

    ------------------

    Vincent van den Braken
    EMail: [email protected]
    ICQ: 15440110
    Homepage: http://www.azzmodan.demon.nl




  3. #3
    Junior Member
    Join Date
    Jan 2000
    Location
    MFAU
    Posts
    19

    Post

    try replacing the space with a %20 or %2D i forget which, they replace the spaces and the server will understand them.

  4. #4
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    does this work?

    Code:
    Dim strtemp As String
    strtemp = "/azzmodan file/file1.zip c:\temp\file1.zip"
    ftp.execute "ftp://1.1.1.1", "get " & strtemp
    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company

  5. #5
    Lively Member
    Join Date
    Jan 1999
    Location
    Karjalohja, Finland
    Posts
    123

    Post

    Try this way:

    'Initialize your connections
    Inet.AccessType = icUseDefault
    Inet.Protocol = icFTP
    Inet.URL = "ftp.YourUrl.com"
    Inet.UserName = "YourUserName"
    Inet.Password = "YourPassWord"
    Inet.RemotePort = 21
    Inet.RequestTimeout = 60

    'What folder you want to go
    Inet.Execute , "CD azzmodan file"
    Do
    DoEvents
    Loop While Inet.StillExecuting

    'Get file in IIS
    Inet.Execute , "GET file1.zip C:\Temp\file1.zip"
    Do
    DoEvents
    Loop While Inet.StillExecuting

    'Close your connections
    Inet.Execute , "QUIT"
    Do
    DoEvents
    Loop While Inet.StillExecuting

    - Dj4

  6. #6
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    I realised last night that my posting wouldn't work!


    have you tried this sort of thing?
    Code:
    Dim RemoteFile As String
    Dim LocalFile As String
    RemoteFile = "'/azzmodan file/file1.zip'"
    LocalFile = "'c:\temp\file1.zip'"
    ftp.Execute "ftp://1.1.1.1", "get " & RemoteFile & " " & LocalFile
    I never have much luck with the Internet transfer control and prefer to use APIs to Wininet dll




    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company

  7. #7
    Guest

    Post

    aussiejoe:
    That didn't work, i tried the %20 like webbrowsers do it, it just reply's that the Dir Azzmodan%20File doesn't exist.

    dj4:
    No luck, and even if it would it would only be a cheap work around, because in the dir is a file with a space in the name.


    Mark Sreeves:
    Tried that to, didn't work either
    I normally use the wininet.dll but for this project I MUST use the ITC


    My first question on this board and no one is able to help me

    Thanks guys ill keep looking around

    (Or ill just tell my boss it can't be done and that i need ascii transfer anyway.)

    ------------------

    Vincent van den Braken
    EMail: [email protected]
    ICQ: 15440110
    Homepage: http://www.azzmodan.demon.nl





    [This message has been edited by Azzmodan (edited 01-26-2000).]

  8. #8
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    Get rid of the F****** space!

    Proper servers (ie. UNIX) don't allow it anyway!

  9. #9
    New Member
    Join Date
    Jan 2000
    Location
    Toronto, Ontario, canada
    Posts
    3

    Post

    TRY THIS

    ftp.execute "ftp://1.1.1.1", "get '/azzmodan file/file1.zip' c:\temp\file1.zip"

    OR THIS

    DIM VBQUOTE=CHR(34)
    ftp.execute "ftp://1.1.1.1", "get " & VBQUOTE & "/azzmodan file/file1.zip" & VBQUOTE & " c:\temp\file1.zip"

  10. #10
    New Member
    Join Date
    Jan 2000
    Location
    Toronto, Ontario, canada
    Posts
    3

    Post

    Guess I should proof read first!!

    TRY THIS

    ftp.execute "ftp://1.1.1.1", "get '/azzmodan file/file1.zip' c:\temp\file1.zip"

    OR THIS

    CONST VBQUOTE=CHR(34)
    ftp.execute "ftp://1.1.1.1", "get " & VBQUOTE & "/azzmodan file/file1.zip" & VBQUOTE & " c:\temp\file1.zip"

    Better yet, run ftp from the dos prompt to figure out the correct FTP syntax is, then work to replicate it in VB

    it should probably look like this

    get "/azzmodan file/file1.zip"
    c:\temp\file1.zip"

    on a single line of course

    ------------------

  11. #11
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    Azzmodan

    You've got me puzzled now!

    continuing our discussion on: http://www.vb-world.net/ubb/Forum4/HTML/000900.html

    I had a play around with my website on virgin.net which I was sure was a UNIX system, and that dows seem to allow spaces.

    When I was a University I did most of my work on a UNIX system and I certainly couldn't have spaces then! I know there are serveral differnt flavours of unix.

    Maybe webserversare different.

    secondly, I feel I must retract my comment about unix being proper servers.

    I am suddenly an NT Server devotee!

    I have been developing a (prototype) "web Based" mantenance tool to run on an intranet which runs happily on an NT server. My system uses ASPs to access data in a database. I have written two DLL which access the database (as well as using an ODBC connection), write a set of files to the hardrive and then FTP them to a UNIX box where they ae used as input files for another system.

    Yeah so what! I hear you say.

    Well, the thing is, it seems that the customer probably wants to use Netscape Server instead of NT Server!

    That's right.
    No embedded DLLs
    No easy peasy databse connections,
    No VB Script
    and my 1000 + lines of code in ASPs will go straight in the bin!

    I think I'm going to cry!



    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width