locked
problem in using CD command with Internet Transfer Control RRS feed

  • 問題

  • hi all,

    i am writing a program to download the files from FTP server using internet transfer control in visual basic 6. On FTP server files that i want to download resides in folder which has the path like /ftpuser7855/File Download/ ,  I have written the following code

    dim strFTPDir as String
    strFTPDir = "/ftpuser7855/File Download/"
    Form1.netDownload.Execute Form1.netDownload.URL, "cd " + strFTPDir 

    but when i am trying to execute the code it does not goes to the directory /ftpuser7855/File Download/ because folder File Download contains the space in its name.

    How to get inside the folder which has space in its name using CD command of Internet Transfer Control??

    i have tried the following solutions

    I.If we want to create the folder with space in its name like "File Download" , we need to use FTP command mkdir "File Download"  means we need to put the folder name in the double quotes. so i modified the above program in following way

    dim strFTPDir as String
    strFTPDir = "/ftpuser7855/File Download/"
    strFTPDir = Mid(strFTPDir , 1, 13) & """" & Mid(strFTPDir , 14, 13) & """" & "/"  ----->this statement returned me string as  /ftpuser7855/"File Download"/

    Form1.netDownload.Execute Form1.netDownload.URL, "cd " + strFTPDir   


    still i am not able to go inside the folder /ftpuser7855/File Download/

    II.
    space character has the special value %20 so i have written the following code

    dim strFTPDir as String
    strFTPDir = "/ftpuser7855/File Download/"
    strFTPDir = Mid(strFTPDir , 1, 17) & "%20" & Mid(strFTPDir , 19, 9)  ----->this statement returned me string as  /ftpuser7855/File%20Download/
    Form1.netDownload.Execute Form1.netDownload.URL, "cd " + strFTPDir   

    Still both the solutions does not worked but if i am renaming the folder File Download to File-Download then i am able to go inside the folder and able to get all the files.


    Please tell me the solution.....its urgent


    regards,
    Pandurnag Pokharkar


    2008年10月21日 10:01

解答

  • try to put a ' before and end of the string,

     

    strFTPDir = " '/ftpuser7855/File Download/' "

    2008年10月27日 5:56

所有回覆