Results 1 to 9 of 9

Thread: [RESOLVED] Inet "Put"; Space in name problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    248

    Resolved [RESOLVED] Inet "Put"; Space in name problem

    Hi all,

    I'm writing a program that has this line of code:
    Code:
    FTPInet.Execute , "Put C:\Program Files\ArbChat\CNs.txt ArbChat/CNs.txt"
    I couldn't get it to work for ages, then I realised that the problem was "Program Files" - There's a space between the two, and it thinks that's the point that it needs to stop reading, and the next part is the file to be uploaded.

    I tried using the age-old internet method of adding %20 instead of a space, but as this is a local file it doesn't seem to work. I tested it with exactly the same code, but "ProgramFiles" (without the space), and created the directory, and it worked fine.

    Any ideas how I can tell it that the space is part of the filename?

    Thanks ^_^
    Last edited by BubbleLife; Dec 10th, 2005 at 05:40 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Inet "Put"; Space in name problem

    Rather than figuring out how to tell it that a space is part of the file name, wouldn't it be easier to just move your text file to a folder location that did not have a space in the folder name?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    248

    Re: Inet "Put"; Space in name problem

    Well, that was one option I considered.. I googled and forumum searched for quite a bit, checked out MSDN, etc but the only examples/threads i could find, either had no spaces or they couldn't figure out a way to fix it.

    It's just, professional programs are stored in C:\Program Files so that's where i'd rather store it. Plenty of commercial and even home-created programs connect to the internet so it seems a shame if I can't get mine to

  4. #4
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Inet "Put"; Space in name problem

    Already tryed this?
    FTPInet.Execute , "Put C:\Progra~1\ArbChat\CNs.txt ArbChat/CNs.txt"

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    248

    Re: Inet "Put"; Space in name problem

    Yup, tried that, no dice T_T
    Also tried making "C:\Program Files\ArbChat\CNs.txt" a variables and just doing
    FTPInet.Execute , "Put " Var & " ArbChat/CNs.txt" and various things using the Chr(34)

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Inet "Put"; Space in name problem

    Quote Originally Posted by Arby
    It's just, professional programs are stored in C:\Program Files so that's where i'd rather store it. Plenty of commercial and even home-created programs connect to the internet so it seems a shame if I can't get mine to
    I would like to point out that this is not universally true.

    I'm a commerical developer and when a customer installs whichever one of our products that they have purchased, our installation and setup program does not use Program Files. We create a folder off of the root of c:\ that is named the same as the purchased product. All of our software is then installed off of this folder.

    I know other commerical developers in other companies, and pretty much their companies follow this procedure as well.

    One of the reasons that we do not use Program Files is because of the space in the folder name.

    Admittedly, however, there are many commerical companies (Microsoft being one of them of course) that do install all of their software off of Program Files)

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    248

    Re: Inet "Put"; Space in name problem

    I see.. Alright, I'll set it all to install to C:\ArbChat rather than Program files. I have seen/used/got programs that install to C:\, i just assumed that using the Program Files folder was universally standard.. for example, i have the vast majority of programs installed to Program Files, and that was the default install directory

    Thanks anyway

  8. #8
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: [RESOLVED] Inet "Put"; Space in name problem

    Quote Originally Posted by Arby
    Hi all,

    I'm writing a program that has this line of code:
    Code:
    FTPInet.Execute , "Put C:\Program Files\ArbChat\CNs.txt ArbChat/CNs.txt"
    I couldn't get it to work for ages, then I realised that the problem was "Program Files" - There's a space between the two, and it thinks that's the point that it needs to stop reading, and the next part is the file to be uploaded.

    I tried using the age-old internet method of adding %20 instead of a space, but as this is a local file it doesn't seem to work. I tested it with exactly the same code, but "ProgramFiles" (without the space), and created the directory, and it worked fine.

    Any ideas how I can tell it that the space is part of the filename?

    Thanks ^_^
    Try this:
    VB Code:
    1. FTPInet.Execute , "Put " & """C:\Program Files\ArbChat\CNs.txt ArbChat/CNs.txt"""
    I think it will work for you.
    CS

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    248

    Re: [RESOLVED] Inet "Put"; Space in name problem

    Ah, I've switched my program to all write to C:\ now.. But I ran this code on my test app and it works! Thank you ^_^

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